1 reply [Last post]
Sousuke_Alexein
Sousuke_Alexein's picture
Offline
newbie
Last seen: 6 years 39 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
Tony's picture
Offline
Moderator
Brisbane
Last seen: 3 weeks 3 days ago
Brisbane
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.