[Pro] Header Tags (h1, h2, h3)

I frequently find myself creating a lot of variants of the h1, h2, and h3 style tags simply because I need to change the color of the font depending on where it appears in my websites i.e. black, white, color). For the most part, all of the other font attributes are the same, only the color differs.

My fear is that should I want to refresh the website with a new font I’ll need to modify numerous styles to account for the color attribute.

Is there anyway to specify a global style that contains all of the font specifications except color, and then apply the color on an item by item basis, without generating a completely new style?


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

Hi,

I usually add colour with a style dedicated to the colour, then if I need to change the colour of the type on an item I just add the style for that colour to it.

This way you can change the colour easily and you only need one main font style which you add the colour you need to it when and where you need.

Hope that Helps…

Cheers,

Steve.

On 2 Oct 2013, at 04:41, RavenManiac wrote:

I frequently find myself creating a lot of variants of the h1, h2, and h3 style tags simply because I need to change the color of the font depending on where it appears in my websites i.e. black, white, color). For the most part, all of the other font attributes are the same, only the color differs.

My fear is that should I want to refresh the website with a new font I’ll need to modify numerous styles to account for the color attribute.

Is there anyway to specify a global style that contains all of the font specifications except color, and then apply the color on an item by item basis, without generating a completely new style?


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

Design Artwork Illustrations & Websites
Steve Ballinger
SBDesign
email@hidden


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

Freeway Pro encourages you to apply styles in a very granular way –
treating every element like a board in a picket fence. You paint them
one-by-one and that’s it. Want to change color or font-family? Then find
that board/item and manually change it.

CSS, however, gives you some other options to consider that automate the
whole process in a smart and creative way.

For example, I usually apply basic color and font-style to the body tag -
that’s right, there is already an html tag called body (NOT to be confused
with the popular .body style users tend to make for their ordinary text).
This sets the general color and font for all my text automatically… I can
type whole paragraphs without applying a style, and headlines too with just
the appropriate h tag (1, 2, or 3). Granted, the Freeway work view doesn’t
reflect this very well, but it is fictitious anyway so I don’t care. My
resulting code is cleaner and looks more professional.

If I want headlines to have a different font or color than other text
types, then instead of repeating these new properties for each h style tag
I make a group CSS Tag style, like this: h1, h2, h3, h4 – the commas in
the CSS selector are used to group these together for whatever properties
you want to apply to them. Again, this is not a style that you have to
“apply” - the browser will do all that for you. And, again, FWP won’t apply
it within the work view.

Okay, so now I am effecting general copy and headlines without ever having
to “apply” a single .style3748b17 to anything. But what if I want a
specific item to be different than the rest?

Often I like my header h1 to be different than all the other headlines on
the page – in color, size, font and style. The Freeway Way would be to
make style h1.styleXYZ and apply it to the h1 in the header element. On
every single page. Like painting boards in a picket fence. The CSS Way
would start by asking “what is unique about this element?” Simply put, it’s
an h1 headline found only in the html5 header element. So I make a Tag
style with the selector name “header h1” – this is a “descendant” selector
because the space between them is the CSS way of saying “all h1 elements
that are found inside (or descended from) header elements”. So, whatever
style properties I define there just apply in the browser… no need to apply
it in FWP.

And that’s just the simple stuff. CSS let’s you write styles just about any
way you can think, target anything you want. Of course, it lets you be
practical too - painting one board at a time, if you like.

The real beauty of all this cleverness shows when I want to make a change -
which is what you originally asked about. See, I don’t have to touch my FWP
workspace… a simple Edit Styles instead of hunt for every occurrence on
every page does the trick.


Ernie Simpson

On Tue, Oct 1, 2013 at 11:41 PM, RavenManiac email@hidden wrote:

I frequently find myself creating a lot of variants of the h1, h2, and h3
style tags simply because I need to change the color of the font depending
on where it appears in my websites i.e. black, white, color). For the most
part, all of the other font attributes are the same, only the color differs.

My fear is that should I want to refresh the website with a new font I’ll
need to modify numerous styles to account for the color attribute.

Is there anyway to specify a global style that contains all of the font
specifications except color, and then apply the color on an item by item
basis, without generating a completely new style?


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

Wow. Thanks for the explanation and advice.

Just to clarify, I’m already using styles, but after a review of some of my more recent websites, I’m clearly on style overload, so in order to simplify my work and make it more easily updatable, I need to refine my use of styles. I do have a few questions though.

  1. I’m a little confused about the use of the body tag. I tend to use the p tag instead, but only because the p tag is used extensively with Perch. What’s the difference between the two and why would you use one over the other?

  2. Is there an unwritten rule as to how many “decedent” header tags are too many? I would assume the fewer the better, but I’m just curious as to the limits most people employ.

Thanks for your help.


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

On Oct 2, 2013, at 9:10 AM, RavenManiac wrote:

Wow. Thanks for the explanation and advice.

Just to clarify, I’m already using styles, but after a review of some of my more recent websites, I’m clearly on style overload, so in order to simplify my work and make it more easily updatable, I need to refine my use of styles. I do have a few questions though.

  1. I’m a little confused about the use of the body tag. I tend to use the p tag instead, but only because the p tag is used extensively with Perch. What’s the difference between the two and why would you use one over the other?

Not every bit of text on your page will be in a P tag. Headers would naturally be in an Hn tag, list items would be in LI tags, etc. So if you only style the P, then all those others would have to be styled separately.

  1. Is there an unwritten rule as to how many “decedent” header tags are too many? I would assume the fewer the better, but I’m just curious as to the limits most people employ.

I hope you mean descendant! (Decedent is a dead person.) The answer is “as many as needed”. Look at your overall goal – how much variety do you need in your page, what can you get away with setting further up the chain? The point that Ernie was making here is that you should do the very least in your individual styles, that way there is less to change later. If the entire sidebar is going to be in Helvetica, and the rest of the body is going to be in Georgia, then I would set the body tag to use Georgia, and then the #sidebar ID to use Helvetica. The only font styles you should set in your actual P, H1, H2, LI styles should be fragment styles – say, only the size, or only the space after or similar. Don’t set the font at all in those, and they will inherit from the nearest parent.

Inheritance is a whole other topic that deserves experimentation and play. By setting broad strokes at the top-most level, and finer and finer strokes further down the hierarchy, you can build up very complex styles at the local level without having to duplicate anything.

Walter


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

I hope you mean descendant! (Decedent is a dead person.)

Yes I did. Unfortunately, my battles with typing quick and spell checkers continues. :slight_smile:


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

I wonder why Perch insists on using the p tag for most of their templates?


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

Because they are putting paragraph content into them? Are they setting heads in P tags also? I haven’t used Perch in over a year, so I can’t recall just how they have set things up. If your template is for an entire page, is there a separate header element with an H1 in it somewhere on the page?

Walter

On Oct 2, 2013, at 9:29 AM, RavenManiac wrote:

I wonder why Perch insists on using the p tag for most of their templates?


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

Not that I’m aware. Unfortunately, Perch’s use of the p tag for CMS content means I have to use the p tag as well if I want to style their content on my FWP page. If I was more adept at CSS I may be able to figure out a way around that.


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

Could you make an example page somewhere, and maybe color the perch stuff yellow or something so I can see what you’re talking about here? There’s almost always a way to reach in with tweezers and adjust the mizzen-mast of your ship in a bottle using CSS. It’s endlessly flexible that way. The only peril is making your style selectors too specific, because then they cannot be overridden further without lots of gymnastics.

Walter

On Oct 2, 2013, at 9:38 AM, RavenManiac wrote:

Not that I’m aware. Unfortunately, Perch’s use of the p tag for CMS content means I have to use the p tag as well if I want to style their content on my FWP page. If I was more adept at CSS I may be able to figure out a way around that.


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

Also, the Perch templates are just a starting point, and they expect you to write your own extensions to them to make the site work the way you want it to. No rules exist that force you to use a P where a different tag would make more sense. (Well, except for the HTML validator’s rules, that is.)

Walter

On Oct 2, 2013, at 9:41 AM, Walter Lee Davis wrote:

Could you make an example page somewhere, and maybe color the perch stuff yellow or something so I can see what you’re talking about here? There’s almost always a way to reach in with tweezers and adjust the mizzen-mast of your ship in a bottle using CSS. It’s endlessly flexible that way. The only peril is making your style selectors too specific, because then they cannot be overridden further without lots of gymnastics.

Walter

On Oct 2, 2013, at 9:38 AM, RavenManiac wrote:

Not that I’m aware. Unfortunately, Perch’s use of the p tag for CMS content means I have to use the p tag as well if I want to style their content on my FWP page. If I was more adept at CSS I may be able to figure out a way around that.


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


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

Here’s a Perch enabled page with comments to indicate where Perch code is being inserted. blog.css is the modified Perch CSS.

http://www.williamsburgmemorialpark.com/about/post.php?s=2013-06-01-customer-care-center-now-open


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

  1. I’m a little confused about the use of the body tag. I tend to use the p tag instead, but only because the p tag is used extensively with Perch. What’s the difference between the two and why would you use one over the other?

Not every bit of text on your page will be in a P tag. Headers would naturally be in an Hn tag, list items would be in LI tags, etc. So if you only style the P, then all those others would have to be styled separately.

Walter

So basically anything except for paragraph text (p tag) items would default to whatever the body tag style was if the respective element (h tags, lists, etc.) weren’t already styled. Is that correct?


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

Exactly.

Walter

On Oct 2, 2013, at 11:07 AM, RavenManiac wrote:

  1. I’m a little confused about the use of the body tag. I tend to use the p tag instead, but only because the p tag is used extensively with Perch. What’s the difference between the two and why would you use one over the other?

Not every bit of text on your page will be in a P tag. Headers would naturally be in an Hn tag, list items would be in LI tags, etc. So if you only style the P, then all those others would have to be styled separately.

Walter

So basically anything except for paragraph text (p tag) items would default to whatever the body tag style was if the respective element (h tags, lists, etc.) weren’t already styled. Is that correct?


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 way that the cascade works is this. The further away from the current element a style is declared (and this distance is metaphorical, not literal) the less influence it has on that element. If your body style sets the font to Helvetica, then the only place where that font will appear are places where there hasn’t been a more specific font choice made. Body is the parent of all visible things on the page. But each other element on the page may set its own font preference, and the closest one will “win”, all other things being equal.

The weight of each type of style declaration gets very technical very quickly, and it’s easy to become confused. Here’s an example document that doesn’t use anything more complex than a single level of ancestry; see if you can figure out how it works.

http://scripty.walterdavisstudio.com/fonts.html

When you’ve gotten through this, I will show you some more esoteric stuff that will lend credence to my standard “ship in a bottle” joke. (There’s already one easter-egg in here with the green first article title.)

Walter

On Oct 2, 2013, at 11:07 AM, RavenManiac wrote:

  1. I’m a little confused about the use of the body tag. I tend to use the p tag instead, but only because the p tag is used extensively with Perch. What’s the difference between the two and why would you use one over the other?

Not every bit of text on your page will be in a P tag. Headers would naturally be in an Hn tag, list items would be in LI tags, etc. So if you only style the P, then all those others would have to be styled separately.

Walter

So basically anything except for paragraph text (p tag) items would default to whatever the body tag style was if the respective element (h tags, lists, etc.) weren’t already styled. Is that correct?


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