1 reply [Last post]
Sousuke_Alexein's picture
Last seen: 7 years 8 weeks ago
Timezone: GMT-4
Joined: 2015-09-05
Posts: 1
Points: 2

I have just started writing in HTML5 and learning CSS as I go along. The book I am using tells me that I should create a
<div> tag and assign an id tag like #wrapper to everything inside the body to make it a certain width. I tried assigning that id to the body tag it did the same thing, however, it was a little bit wider. What is the difference and which one is correct?

Tony's picture
Last seen: 1 week 3 days ago
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5344
Points: 2965

It's possible you have

It's possible you have misinterpreted the instructions.
Id's need to be unique, so only one element should have a wrapper.
div's by default will be full width block elements, so you only need to set width if you change the display property or float it.