Basics i think im missing the point on please help

Associate
Joined
14 Jan 2010
Posts
134
Location
Humberside uk
Hi Guys

i been bobing around here a while i think i have missed the point on a few basics and hoped you could clear a few things up for me in plain speak if possible still not up on all the jargon ect.

what is the difference between

<div id"blahblah">
<div class"blahblah1">
and < div "wrapper">

i feel like these should be basics and wondered if someone could set me streight.

cheers evil
 
id and class serve similar purposes, which is to identify items (in your examples "div"s) to apply formatting/styling via CSS.

An ID can only be applied to a single instance of an item on a page, a CLASS can be applied to many items on a page.

You need an "=" after div or class - and your third example is completely incorrect.
 
ok so i think i get the class and id bit so whats a wrapper

and in what instance would i use one?

thanks for answering
 
ok so i think i get the class and id bit so whats a wrapper

and in what instance would i use one?

thanks for answering

'wrapper' is just an element ID/class name often used by people to style an element that contains most (if not all) other elements in a webpage.

Say, for example, you had the content of your website at a fixed 960px width centred in the browser window, you might make a 960px-wide div element called 'wrapper' and style it accordingly.

There's nothing semantic or meaningful about the use of the name 'wrapper', it's just a common one!
 
Say, for example, you had the content of your website at a fixed 960px width centred in the browser window, you might make a 960px-wide div element called 'wrapper' and style it accordingly.



that actually makes sense as the context i saw it used in was to center a gallary in a browser it was styled using the margin-left:auto and margine-right:auto attributes.

These make a lot more sense now thanks guys
 
Back
Top Bottom