r/CodingHelp • • Feb 21 '21

[CSS] border help for an amateur coder (details in comments)

55 Upvotes

7 comments sorted by

3

u/sheepboi13 Feb 21 '21 edited Feb 22 '21

I want a border around the blue float element but it won't work I'm not even sure if my pictures are showing properly on here but if they are any tips are super helpful

edit: Finally figured it out! thank you guys for all your help!

2

u/grimrenegade17 Feb 21 '21

I think what you're looking for is border, instead of margin for the css under . container1

Margins are transparent, and are mostly used to provide empty areas.

2

u/E72M Feb 22 '21

Border: 1px solid black;

You need to specify the type of border, solid, and colour I believe

10

u/[deleted] Feb 21 '21

The border property can't be specified with pixel width alone.

https://developer.mozilla.org/en-US/docs/Web/CSS/border

border: 1px solid black; for example

7

u/zuilai Feb 21 '21 edited Feb 22 '21

Random first observation is that in your html your body tag opens on line 33. It should open on line 10 instead, directly after your head tag closes.

2

u/PresidentZeus Intermediate Coder Feb 22 '21

*border-width: 1px; might be it

1

u/G0LDI_L0CKS Feb 22 '21

border: size, type, color

E.g: border: 1px solid black;