[Pro] p tag or .body style?

I think I understand the differences between these two types of tags, but in practice is it better to use the p tags or a .body styles for the default styling of your web page?

Also, I noticed that if I have a list of items, the .body style will properly style the list, but the p tag will not. How do you style lists in that situation?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi
the differences between the

 <p>   </p>  

tags and the

 <body>  </body> 

tag is that the body tag is a single tag which encompasses everything you see within the visual html page and its this reason why there should only be one tag on a page.

So if you imagine the body tag wraps around the H tags, P tags, UL tags etc… and as such means thats everything could potentially inherit any style thats added to the body tag. The P tag on a page is a paragraph tag and even though there are loads of them they won’t necessarily be wrapped around other tags and in-turn, won’t effect them for example H tags or UL lists etc .

  1. If you want test this out just create a new freeway document

  2. then adjust the standard p tag by adding the colour red within edit styles

  3. then on you artwork write some text… you should see the text is red

  4. now hit return and type some more text then highlight the second line and within the inspector palette click on H1

  5. now you should see that red colour has gone and is black. This is because the P tag no longer is wrapping around this second line but is now wrapped by an H tag and therefore no red colour.

  6. ok now go back to edit styles so we can create a new style attribute for a new tag…
    so click new (plus button) then click in the tag field and type:

    body

  7. make sure the Name field is blank

  8. add the colour blue to this new tag style and save

  9. go back to the artwork and you should see that now the h tag is blue. In fact the p tag would be blue as well, were it not for the fact that you had specified the colour red on p tag specification which in-turn overwrites the inherited body (blue) colour.

I hope this helps
all the best max


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Max does a very nice job of pointing out the differences in the two types
of containers. :slight_smile:

So, following Max’s explanation, it is practical to use the body tag when
you want to make a global setting on the page. I use it to set my basic
font settings like font-family, line-height, letter-spacing, color and base
size. Then I set specific deviations using the appropriate tags (h1, h2,
etc.) I almost never touch the p tag as all my other text styles will be
span classes (like strong or em) and so don’t care whether it is applied to
a paragraph, header or list item.

However, you should not treat lists like paragraphs… generic attributes
shared by all elements are okay but specific attributes should be targeted
with the appropriate tags, otherwise you could end up with a real mess.

If you plan your styling, then you’ll be rewarded with cleaner, more
professional-looking code… no need to tell the browser to apply the same
style to every paragraph. Just the right style at the right place.


Ernie Simpson

On Sat, Jun 9, 2012 at 2:15 AM, RavenManiac email@hidden wrote:

I think I understand the differences between these two types of tags, but
in practice is it better to use the p tags or a .body styles for the
default styling of your web page?

Also, I noticed that if I have a list of items, the .body style will
properly style the list, but the p tag will not. How do you style lists in
that situation?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

The main reason I asked about this is Perch uses the p tag pretty extensively in its code , so I though by using the body tag I was doing something wrong.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

The main reason I asked about this is Perch uses the p tag pretty extensively in its code , so I though by using the body tag I was doing something wrong.

Perch uses the Textile editor which by default inserts

tags. This is not always useful so you can easily disable it by changing the template setting from

textile=“true”

to

textile=“false”

Depending on what you’re trying to accomplish it may be the best option.

Todd


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks Todd. Okay, stupid question. What is a Textile editor and what happens to the Perch tags if I change it to “false”?

On 9 Jun 2012, 4:23 pm, Todd wrote:

The main reason I asked about this is Perch uses the p tag pretty extensively in its code , so I though by using the body tag I was doing something wrong.

Perch uses the Textile editor which by default inserts


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I wasn’t entirely accurate in my previous post. Perch uses Textile which is the markup language used to format your content and the MarkItUp editor which is what the toolbar is for. Textile is what inserts all those

tags. Your Perch tags, i.e., the content tags you insert into the html are not affected by changing Textile to false. What it does affect is the code-level formatting of the content you add via the control panel. If all the

tags are causing issues then disabling Textile may be necessary.

On a side note, Perch accepts different plug-in editors other than MarkItUp so that’s another option if you don’t care for the default setup.

Todd

On Jun 9, 2012, at 1:16 PM, RavenManiac wrote:

Thanks Todd. Okay, stupid question. What is a Textile editor and what happens to the Perch tags if I change it to “false”?

On 9 Jun 2012, 4:23 pm, Todd wrote:

The main reason I asked about this is Perch uses the p tag pretty extensively in its code , so I though by using the body tag I was doing something wrong.

Perch uses the Textile editor which by default inserts


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options