Span questions

This is a discussion on "Span questions" within the Web Page Design section. This forum, and the thread "Span questions are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Aug 6th, 2006, 19:28
Junior Member
Join Date: Jul 2006
Location: London
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Question Span questions

Hi

When I first used css I had some issues around the <span clsdd="lkhkjh">kjdhdsf</span>. I can't remember why but I got the idea that I shouldn't use it.....

Now that I am getting a littlre more confident I find that I want a selector that carries none of its own formating (yes I know its inline).

Am I correct in thingking that I should use:
  • "span" with class="...."
and
  • div with id="...." and that if I define styles the other way around there will be problems???
Using <span> would certainly make things easier - I have been using
p {display:inline;}

which works but is a pain...

thanks

Edward
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Aug 6th, 2006, 20:08
Reputable Member
Join Date: Jul 2005
Posts: 400
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Span questions

divs are for defining sections

spans are for adding style to specific elements and aren't supposed to serve as dividers

Code: Select all
<div id="foo1">
 <h2>This is a Header</h2>
 <p>this is some <span id="foo2">text</span></p>
</div>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Aug 7th, 2006, 11:07
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Span questions

To clarify one of your other questions:

Use class where you expect there to be multiple occurances of that styling on a page.

Use id when you want some unique styling, as there should only be one occurance of each id on a page, but you can of course use the same id on a different page.

'class' and 'id' can be used on any element.
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

Tags
span, questions

Thread Tools

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can <span></span> tags have position relative? Oak Web Page Design 13 Mar 9th, 2008 17:04
From table tags to div and span abdoukadri Web Page Design 6 Dec 5th, 2007 22:57
<SPAN> help Access JavaScript Forum 2 Nov 3rd, 2007 18:13
Div and Span tags... jjgamepro17 Web Page Design 4 Nov 7th, 2006 19:22
Wrapping by span hessodreamy Web Page Design 3 Sep 14th, 2005 07:34


All times are GMT. The time now is 23:33.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

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