I want to circumscribe CSS text

I want to circumscribe the text into a square.

Hi @TasosKhatzes. If i’m understanding you correctly, you wish to basically but a box around some text. The easiest way to do this is with a border.

An example of this for your heading would be

h3 { border: 1px solid black; }

Take a look at CSS Borders for more info! :slightly_smiling_face:

This is the output of the webpage

I want my text be like that without the outline

you can add width to the element


You can change “class_name” to what you want and then add it to the h3 like this:

<h3 class="class_name">...</h3>

I tried that but it works only with inline code:

<p style="wdth: 500px;"> text </p> 

hi @TasosKhatzes

Are you putting the CSS into the style.css file? It should work if placed there.

Yes I plased it there, but still don’t works

you haven’t linked the file

<link rel=stylesheet href=style.css>

width is spelt wrong so that might be the problem because it works for me.

I agree with @UMARismyname you have deleted the link tag from the <head> section of your HTML file.

Taken from a fresh HTML Repl

  <link href="style.css" rel="stylesheet" type="text/css" />
1 Like

Thank you! Now it works

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.