I want to circumscribe CSS text

I want to circumscribe the text into a square.
https://replit.com/@TasosKhatzes/WHAT-IS-PROGRAMMING-WITH-CSS?v=1

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

.class_name{
    width:400px;
}

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

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

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>
3 Likes

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.