Font-family

  • Thread starter Luigi Donatello Asero
  • Start date
L

Luigi Donatello Asero

Hello,
I was wondering whether to use different font-families for the different
<div>s might be a good way to style the different paragraphs...
For example to use
{font-family: serif;} for one of these...
 
H

Harlan Messinger

Luigi said:
Hello,
I was wondering whether to use different font-families for the different
<div>s might be a good way to style the different paragraphs...
For example to use
{font-family: serif;} for one of these...
Have you ever read a book where each paragraph was in a different font?
Or is that not what you're asking?
 
L

Luigi Donatello Asero

Harlan Messinger said:
Have you ever read a book where each paragraph was in a different font?


Probably not.
But it seems as each heading should have a <div> cointainer and therefore I
wonder how I could style the different cointainers.
One colour for each paragraph would not look well, either....
 
D

David Dorward

Luigi said:
But it seems as each heading should have a <div> cointainer

Headings are block level elements and may be child elements of the body.
and therefore I wonder how I could style the different cointainers.
One colour for each paragraph would not look well, either....

The traditional method of identifying where one paragraph ends and another
begins on the WWW is through margins.
 
L

Luigi Donatello Asero

Andy Dingley said:
I sometimes wonder if Luigi has even read a book...

Perhaps more than you might imagine.....
I began reading the "Enciclopedia Treccani" when I was a child....
 
L

Luigi Donatello Asero

David Dorward said:
Headings are block level elements and may be child elements of the body.


Yes, but why do you not have a look at these examples?
http://www.w3.org/TR/html401/struct/global.html#h-7.5.5
The traditional method of identifying where one paragraph ends and another
begins on the WWW is through margins.

Every <div> should have an "id" or at least a "class".
Having said that, what is that it would make a <div> just that <div>??
 
L

Luigi Donatello Asero

Luigi Donatello Asero said:
Yes, but why do you not have a look at these examples?
http://www.w3.org/TR/html401/struct/global.html#h-7.5.5

Please, have a look at this example
on the page
http://www.w3.org/TR/html401/struct/global.html#h-7.5.5
where there is the following

<DIV class="subsection" id="forest-habitat" >
Here you have a <div> with an "id".
That means that there cannot be any other which is the same.
Now, how would you style this <div> in a way that it would make it unique?
Would you style the colour or perhaps the fonts?
 
D

David Dorward

Yes, but why do you not have a look at these examples?
http://www.w3.org/TR/html401/struct/global.html#h-7.5.5

Yes? You can mark up sections of a document using div elements. It can be
useful to do so under some circumstances. It isn't required, and there is
no mention of "SHOULD" there.
Every <div> should have an "id" or at least a "class".

No. Only add markup if it is going to be useful. Giving an element an id or
class just because you are adding an element is wasteful.
Having said that, what is that it would make a <div> just that <div>??

I have no idea what you are trying to ask there.
 
L

Luigi Donatello Asero

David Dorward said:
body.

Yes? You can mark up sections of a document using div elements. It can be
useful to do so under some circumstances. It isn't required, and there is
no mention of "SHOULD" there.



No. Only add markup if it is going to be useful. Giving an element an id or
class just because you are adding an element is wasteful.

So, do you mean that W3 does not recommend to use a <div> for each heading ?
Headings are useful because they give an overview for the readers
and can be read by text browsers and robots as well
 
L

Luigi Donatello Asero

David Dorward said:
unique?

WHY would I want to style that div in such a way as to make it look
unique?

Because it has its own "id". It seems to me as if one would otherwise
distinguish the <div>s by calling them by different names on the one hand,
but, on the other hand, display them as if all of them were the same.
 
D

David Dorward

Luigi said:
So, do you mean that W3 does not recommend to use a <div> for each heading
?

They make no comment either way. The spec does not require it.
Headings are useful because they give an overview for the readers
and can be read by text browsers and robots as well

What does that have to do with putting them inside divs?
 
J

Jonathan N. Little

Luigi said:
Perhaps more than you might imagine.....
I began reading the "Enciclopedia Treccani" when I was a child....
And each paragraph, section and article was a different font or color,
right?
 
D

David Dorward

Luigi said:
Because it has its own "id". It seems to me as if one would otherwise
distinguish the <div>s by calling them by different names on the one hand,
but, on the other hand, display them as if all of them were the same.

Or it might have been given an id so it can be accessed with JavaScript

.... or a server side script

.... or simply so it can be linked to!
 
R

Rik

Luigi said:
So, do you mean that W3 does not recommend to use a <div> for each
heading ? Headings are useful because they give an overview for the
readers and can be read by text browsers and robots as well

What's wrong with:
<hx>heading</hx>
<p>some text</p>
<p>some other text</p>
<hx>next heading</hx>
<p>some text</p>
<p>some other text</p>

When the pargraphs are styled indetically, there is no need for a containing
div.

Div's are to be used if no other element makes sense, don't just use them
because most browsers attach very little standard style, so it's more easily
molded to your wishes. Id's and classes can be usefull for effective markup
or scripting (like javascript). Id's and classes are never required.

Grtz,
 
R

Rik

Luigi said:
Perhaps more than you might imagine.....
I began reading the "Enciclopedia Treccani" when I was a child....

'has read a book' means finished it...

Grtz,
 
L

Luigi Donatello Asero

David Dorward said:
They make no comment either way. The spec does not require it.


What does that have to do with putting them inside divs?


I suppose that I have read somewhere about that.
Anyway, just now I am under the impression that I have some syntax error
somewhere on the page....
the validator shows that a closed tag </div> is lacking but I do not
understand why...
 
L

Luigi Donatello Asero

Luigi Donatello Asero said:
Did you finish reading the "Enciclopedia Treccani"?


Back to Font-Families.....
no matter whether it is necessary or not, at least W3 shows an option
where you have a <div> for each heading...
the pages https://www.scaiecat-spa-gigi.com/it/svezia.html validates
again...
The question is then what to use to style
Fonts and colours seem to be the
most usual options.
But it would probably be a good option to have <h3> which have the same size
regardless of the Font-family.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top