Reply to Re: css and <ul> inside a <p> paragraph

Your name:

Reply:


Posted by Joe Butler on 09/23/07 16:51

OK, thanks for that.

This is the testing area so far...
http://www.hertfordshire-it-support.co.uk/test-lfl/

Any comments welcome on what I've done so far. Note that the site is not
finished in terms of the look or the colours and the banner image is taken
from the original site. I, personlly, don't like it since it has the
appearance of a yellowed 200 year old newspaper, but if the customer wants
to use it, then the colours of the site will be modified to reflect the
banner. I'm interested if people have coments about that - positive or
negative.

I always used to close off paragraphs, but noticed that the w3 validator is
showing valid markup even when they are left open and then saw something
that implied only xhtml required <p> to close, so I assumed it was ok. I'm
doing these pages by hand, and closing off paras is just another detail that
is nice not to deal with.

I hadn't realised about the transitional/strict thing. I'll look into it.

The thing about the <br> tag is it seems cleaner in the overal code
structure -
i.e. not needing to repeat <p class="mycontent"> at each visual para
linebreak. But I guess, if that's the right way to do things, then I'll
modify the html. Perhaps another way would be to contain the paragraphs and
any lists inside a <div class="article-content"> with it's own defined
paragraph left margin. The reason this is importantant is simply that if
the article title style changes so that it is not contained in grey
rectangle, then the left margin may disapear, so I would then want the
entire article content to have no margin so that it lined up with the new
article title style.


"Beauregard T. Shagnasty" <a.nony.mous@example.invalid> wrote in message
news:I%vJi.588652$p47.100772@bgtnsc04-news.ops.worldnet.att.net...
> Joe Butler wrote:
>
>> I have a basic, Title, series of paragraphs, Title, Series of
>> paragraphs, etc. etc. structure to a page.
> <snip>
>> If the paragraphs belonging to a particular title are simply text,
>> then I can break up the paragraphs with <br><br> to give me a blank
>> line between the paragraphs.
>
> If you want a bottom margin after a paragraph, use CSS:
> p { margin-bottom: 2em; }
> instead of <br>'s, which *might* be used within a paragraph (rarely),
> but most commonly within a postal address block, for example.
>
>> Now, if I need to put a list between two of the paragrapsh, the list
>> is not 'inside' the paragraph - I guess you could say it does not
>> inherit the sytle of the paragraph that it is being displayed in.
>
> Paragraphs ( <p> ) cannot contain other block-level elements, such as
> the <ul> you mention. Starting a <ul> closes the <p>.
>
>> Then, when the list ends, I have to re-state that we are using the
>> paragraph style, otherwise the following paragraphs don't have the
>> correct style (mainly the margin indent).
>
> An URL to your page would help.
>
>> So, the question is, what is the correct way to deal with this so that I
>> can
>> say, here are a set of things that are all inside this paragraph style,
>> and
>> things like lists will add their own defined left margins to whatever the
>> containing paragraph style is?
>>
>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
>> "http://www.w3.org/TR/html4/loose.dtd">
>
> New documents should be Strict, not Transitional.
>
>> <p class="article-title">This is the title</p>
> This should probably be an <h1> or maybe an <h2>, if you already have an
> <h1> on the page.
>
>> <p class="article">
>> this is the article text.
>
> You forgot the closing </p>. However, most browsers will implicitly
> close it for you.
>
>> <ul> <-- this is not within the above <p>
>> <li>list item 1.</li>
>> <li>list item 2.</li>
>> <li>etc.</li>
>> </ul>
>>
>> <p class="article">
>> another paragraph.
>
> Let's see the URL to a test case, instead of partial code fragments.
>
> --
> -bts
> -Motorcycles defy gravity; cars just suck

[Back to original 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

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