This is a discussion on "Eliminate spaces" within the Web Page Design section. This forum, and the thread "Eliminate spaces are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
Eliminate spaces
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
I've mastered classes (.whatever) and i'm using them whenever u need to in the xhtml. But they have to be in between <p></p> tags don't they? And this means they create a space that u don't necessarily want. Is there any way of eliminating the space?
Thanks. |
|
|
|
|||
|
Re: Eliminate spaces
to get rid of the spaces created by <p></p> use
|
|
||||
|
Re: Eliminate spaces
No; class tags, as well as ID tags (you sure you know when to use which?) get added as attributes into just about any element. Like this:
|
|
|||
|
Re: Eliminate spaces
I say they must be between <p></p> cos if they aren't then "class="whatever" " is treated as text. No?
<p class="whatever"> hello </p> would output: "hello" in whatever style, but: class="whatever"> hello would output: class="whatever"> hello |
|
|||
|
Re: Eliminate spaces
Well yes, but instead of <p> you can also use <div></div> or <span></span> almost any tag can have a class.
|
|
|||
|
Re: Eliminate spaces
Great. Thanks. Just to clarify: what do they mean, span/div, and what's the difference?
|
|
|||
|
Re: Eliminate spaces
A div is a block, a span is inline.
You use span basicly the same way you would use a paragraph, accept you can have a span inside a paragraph (and I think you can have a span inside a span) Quote:
|
|
|||
|
Re: Eliminate spaces
OK so a div doesn't create any space like a <p> does but it means that whatever follows goes on the next line? Whereas span means you can close stuff and whateevers next is on the same line, side by side like what i've done with the text and flash and have succeeded?
PS, are <br> s OK to use? Are they W3 acceptable? are they written </ br> ? |
|
|||
|
Re: Eliminate spaces
yeah something like that.
use <br /> |
|
||||
|
Re: Eliminate spaces
Quote:
A <p> element on the other hand is supposed to wrap a paragraph of text, and therefore, has natural padding and margins built into it prior to specifying anything with CSS. To keep your code semantic, try to use <p>'s where they're proper; for paragraphs of text. Everything else should get a <div>, <span>, or another appropriate element. <br /> are breaks, and shouldn't be used to mimmick the appearance of paragraphs. They can, it will work, but it's not the right way. A lot of "developers" will do the following to create the appearance of paragraphs:
Last edited by herkalees; Nov 28th, 2005 at 04:55. |
![]() |
| Tags |
| eliminate, spaces |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Extra Spaces! | CloudedVision | Webforumz Suggestions and Feedback | 1 | Jun 2nd, 2008 01:01 |
| How to eliminate the end extension in the address bar? | linda_0 | Web Page Design | 4 | Apr 28th, 2007 19:40 |
| Files names without spaces | cyberseed | Web Page Design | 18 | Dec 18th, 2006 19:16 |
| Spaces in HTML for a template | necron_uk | Web Page Design | 11 | Aug 9th, 2006 14:11 |
| extra spaces removal = bad | jakyra | Webforumz Suggestions and Feedback | 3 | Sep 4th, 2003 18:18 |