Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Old 08-05-2010, 02:16 PM Tooo many Div ID's
Junior Talker

Posts: 3
Trades: 0
Hi,

I'm new to css. I made this site http://www.nottinghamdrivingschool.biz and is the first time I've used css. More of an experimental version really to try and understand it.

After making it I realise that only one div id is supposed to be used and then multiple div class. I've put loooads of div id's one all of the pages.

So I am just wondering,
  • is this site trash now and I pretty much need to rebuild?
  • is it fine to just leave it as it is?
  • is there an option to repair it?
Thanks

Rich
richyp is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-05-2010, 02:24 PM Re: Tooo many Div ID's
Extreme Talker

Posts: 246
Name: Patric
Trades: 0
Honestly, it would work fine the way you have it in my opinion. If you've achieved the desired layout without issues, and the site loads fine, then I would say just leave it.

If you have multiple div ids that are pretty much identical to eachother, then what you could do is just re-assign them to one class you've set up in the CSS and reuse it multiple times. Make sense?
Reckoner is offline
Reply With Quote
View Public Profile
 
Old 08-05-2010, 02:29 PM Re: Tooo many Div ID's
Junior Talker

Posts: 3
Trades: 0
Thanks for that Reckoner.
Wasn't sure if it was some fatal mistake or something.

I think what you said makes sense...right noob on css.
I will study it more taking into account your advice.
richyp is offline
Reply With Quote
View Public Profile
 
Old 08-05-2010, 03:03 PM Re: Tooo many Div ID's
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,376
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
they are not "div ids"

the ID attribute can be applied to every HTML element.

And yes an ID can ONLY be used once on a page.

You CAN however apply multiple classes to an element, with each classname seperated by a space.

you also need to learn about specificity and inheritance for where you have things like

HTML Code:
<div class="footer"><a class="footer" ... >text</a></div>
The anchor element would inherit some properties from the parent and any property you want to change you can target by using descendant selectors.
Code:
.footer a{
/* Rule set*/
}
in the style sheet.
So the classname applied to the anchor is superfluous
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-05-2010, 03:13 PM Re: Tooo many Div ID's
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Your ID's are fine, as long as they are UNIQUE on a page.

However, I make these suggestions:

1 - put your text inside proper <p></p>, don't put text inside unnecessary spans. Style the <p> tag overall, then use classes or spans only where needed.

2- style your links in the same manner
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 08-05-2010, 03:40 PM Re: Tooo many Div ID's
Junior Talker

Posts: 3
Trades: 0
Well that's given me a lot to think about.
Thanks very much for your time!
richyp is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Tooo many Div ID's
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.65710 seconds with 12 queries