You are here: Re: margin for multi-line span? « HTML « IT news, forums, messages
Re: margin for multi-line span?

Posted by wolfing1 on 07/12/06 13:13

Jonathan N. Little wrote:
> wolfing1@gmail.com wrote:
> > Jonathan N. Little wrote:
> >> wolfing1@gmail.com wrote:
> >>> I have a <span> block with text that wraps for several lines. I want it
> >>> with a margin of 20px so I did a...
> >>> <span style="margin-left:20px">.......</span>
> >>> But only the first line showed the margin. How can I have it so all
> >>> the lines resulting from the <span> are shifted 20px to the right? (or
> >>> should I use tables for this?)
> >>>
> >> No, you want a block not inline element.
> >>
> >> <div style="margin-left:20px">.......</div>
> >>
> > eh?
> > thought <div> ignored left and right margins
> >
>
>
> Says who? Not if you style them to have margins. Margins are for block
> elements anyway, DIV is a block element, SPAN is not.
>
Sorry for the stupid questions, I've been using tables all my life but
I'm trying to switch to using styles and stuff for formatting, so I'm
getting into some bumps here and there. So I guess it is wrong then to
define a margin for a span and should instead put a <div> around the
span for the margins? (by the way, I changed the span for div as you
said and it worked perfectly, thanks).
Another question if you all don't mind. With tables I normally used a
CSS file for all the pages, but since I'm now supposed to define all
the styles for each type of <div> and <span> I use in my pages in the
CSS file... guess I should kinda make a CSS per web page now (for each
page's particular style) plus a common one for the common styles?
Because if I put it all in one file as I'm used to, pages will be
including a lot of unnecessary styles (they'd be including styles from
many other pages that the particular page doesn't use)

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация