Web Design and Development Forums

How best to do this using CSS?

This is a discussion on "How best to do this using CSS?" within the CSS Forum section. This forum, and the thread "How best to do this using CSS? are both part of the Design Your Website category.


Go Back   Webforumz.com > Design Your Website > CSS Forum

Welcome to Webforumz.com.
Register Now Register now!

Reply
 
LinkBack Thread Tools Rate Thread
Old Apr 19th, 2008, 12:07   #1 (permalink)
New Member
 
Join Date: Apr 2008
Location: bristol
Age: 37
Posts: 1
How best to do this using CSS?

Presentation within my jsp file is entirely done using class attributes except column width settings on a table. There 2 tables with 11 columns in each all have different widths!

Currently I have inline style attributes like this -
HTML: Select all
  <td style="width: 30%;">Local Authority</td>
Can anyone please suggest how best to do this? would you keep the "style" as they are unique or perhaps create a class style in the css file like so -
Code: Select all
  #wrec_origin_local_authority {
      width: 10px;
      }
So my html would look like this -
HTML: Select all
  <td id="local_authority" class="local_authority">Local Authority</td>
This sound the cleaner route but any thoughts on the way to go?

thanks in advance

harry

Last edited by aso186; Apr 19th, 2008 at 14:51.
harryajh is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 19th, 2008, 14:55   #2 (permalink)
Chief Moderator
 
aso186's Avatar
 
Join Date: Oct 2007
Location: UK
Posts: 701
Blog Entries: 2
Send a message via Skype™ to aso186
Re: How best to do this using CSS?

It's entirely down to your situation.

If you want the flexibility of classes and ID's. then use them. If it's just as easy to edit inline, use inline!

The only thing I'll mention is that inline styles will affect print layouts too (whereas external stylesheets can be assigned to a given media).

If you think you're users will want to print these pages, it's best to use stylesheets and remove the inline styles.
__________________

aso186 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 19th, 2008, 16:39   #3 (permalink)
Junior Member
 
Join Date: Jul 2007
Location: Arkansas, USA
Age: 21
Posts: 44
Blog Entries: 1
Send a message via AIM to nashultz07 Send a message via MSN to nashultz07
Re: How best to do this using CSS?

I would have to agree with aso186, but would also have to say that if you have more than a couple styles the same to go ahead and go with the stylesheet method for easy assigning.

Thanks,
Nathon Shultz
__________________
nashultz07 CSS Trickery: CSS Tips and Tricks
nashultz07 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 20th, 2008, 09:42   #4 (permalink)
Moderator
 
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,155
Re: How best to do this using CSS?

HTML: Select all
<td id="local_authority" class="local_authority">Local Authority</td>
You don't need to assign both ID and CLASS.
MikeHopley is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
Pingbacks are On
Refbacks are On



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 10:21.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59