i'm trying to tidy my code by using customised html tags instead of <span> tags to apply text formatting.
the first problem i've run into is that using <title> makes the affected text disappear in IE5.
does anyone know if there are known problems with this tag or can suggest a possible reason for this...?
thanksCould you define custom tag? Also, there is only one place you are supposed to use the <title> tag. Are using it beyond where you are supposed to, or just trying to customize it where it is used?thanks
well i guess i'm not using it in the correct place cos i dont know where that is.. ;-)
when i say customising i mean i've redefined them in a linked css.
i hoped that i could simply apply the <title> tag the way i would use <b>, <small> or the others i've defined below:
which tags am i safe to redefine in order to apply simple text formatting?
////////////////////////////////////////
body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #999999; line-height: 14px}
p { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; color: #999999; line-height: 12px}
a { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; color: #FF9900; text-decoration: none; font-weight: normal}
a:hover { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; color: #FFCC00; text-decoration: none}
b {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
line-height: 12px;
font-weight: bold;
color: #CCCCCC;
}
title {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 20px;
font-weight: bold;
color: #FFFFFF;
}
small {
font-size: 9px;
color: #666666;
}
.green {
color: #99CC66
}
big {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 20px;
font-weight: bold;
color: #FFFFFF;
text-decoration: none;
}
strong {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
line-height: 12px;
font-weight: bold;
color: #FFFFFF;
}
.small {
font-size: 9px;
color: #666666;
}
////////////////////////////////////////
any suggestions welcomed..Make sure that your page passes the Validator (<!-- m --><a class="postlink" href="http://validator.w3.org/">http://validator.w3.org/</a><!-- m -->) with no errors and I bet that your problem disappears.Just to back up what Charles is saying. The <title> tag should be used once within the <head> tag. What is in the <title> tag is what you see at the very top left of your browser. It sounds more like you want to use something like a <h1>, <h2>, <h3>, etc. tag instead.cool. thank u
however.. if i use h1, h2 etc to format a particular word then it also formats the entire paragraph... this is not so useful for me
do u know which tags i can rededine without causing complications?
so far i have used:
<b>
<strong>
<big>
<small>
what about <blockquotes>? should that only be used in specific situations?try using h1 with it's corresponding /h1 tag:
<h1>Title</h1>
If you close all your elements as appropriate, then you won't have any problems with styles carrying over.Originally posted by schlarto
what about <blockquotes>? should that only be used in specific situations? All elements should be used in specific situations. BLOCKQUOTE is for block quotations. P is for paragraphs. The H elements are for headings.
We're talking here about separating content from presentation. If you mark up the content and meaning of your page then it will make sense no matter how it is presented. Keep in mind Braille and audio browsers.
If it's a heading but you don't want it as a block element then use something like:
<h4 style="display:inline">My Happy Heading</h4>
Always start with a page in HTML 4.01 Strict and then add the presentation with CSS.ok, looks like i was being a dumbass.. using <h1> tags correctly makes all the difference.
thanks for your help ;-)doh...i just realised why the <h> tags aren't ideal...
they appear to automatically create a new paragraph after them
being a picky designer i want only a <br> new line rather than a full gap before the next text... is there a get around for this?<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled</title>
<style type="text/css">
<!--
h1 {
margin-bottom: 0px;
}
-->
</style>
</head>
<body>
<h1>Hello</h1>
Hi
</body>
</html>...and if you don't want the extra space on the top, use margin: 0; rather than just margin-bottom...brilliant
thank youah.. hello again...
is there a way of actually disabling the line break after a <h1> tag so u can put other text on the same line?Charles mentioned it earlier - display:inline;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled</title>
<style type="text/css">
<!--
h1 {
display: inline;
margin-bottom: 0px;
}
-->
</style>
</head>
<body>
<h1>Hello</h1>
Hi
</body>
</html>With display: inline;, you don't need margin-bottom: 0;...Originally posted by pyro
With display: inline;, you don't need margin-bottom: 0;... But with HTML 4.01 Strict the BODY element cannot directly contain PCDATA or inline elements.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Example</title>
<style type="text/css">
<!--
h1 {display:inline; float:left}
-->
</style>
<h1>Mi specisca amecer</h1>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipitlobortis nisl ut aliquip ex ea commodo consequat.</p> yeah I know. I just pasted the line in and it works.
Just out of interest charles, why do you seem to do all of your coding these days without body tags etc?
Oddly enough if you just paste it into the wdg validator and add a p tag around the hi it's valid <!-- m --><a class="postlink" href="http://www.htmlhelp.org/cgi-bin/validate.cgiOriginally">http://www.htmlhelp.org/cgi-bin/validate.cgiOriginally</a><!-- m --> posted by DaveSW
Just out of interest charles, why do you seem to do all of your coding these days without body tags etc?I'm trying to keep my postings as short as possible while maintaining validity. In HTML both the start and end tags for the HTML, HEAD and BODY elements are optional.Some of the tags I use to redefine are <em> <I> <U> then you can add them where you want with not much of a problem just don't forget the closing tags.
the first problem i've run into is that using <title> makes the affected text disappear in IE5.
does anyone know if there are known problems with this tag or can suggest a possible reason for this...?
thanksCould you define custom tag? Also, there is only one place you are supposed to use the <title> tag. Are using it beyond where you are supposed to, or just trying to customize it where it is used?thanks
well i guess i'm not using it in the correct place cos i dont know where that is.. ;-)
when i say customising i mean i've redefined them in a linked css.
i hoped that i could simply apply the <title> tag the way i would use <b>, <small> or the others i've defined below:
which tags am i safe to redefine in order to apply simple text formatting?
////////////////////////////////////////
body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #999999; line-height: 14px}
p { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; color: #999999; line-height: 12px}
a { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; color: #FF9900; text-decoration: none; font-weight: normal}
a:hover { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; color: #FFCC00; text-decoration: none}
b {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
line-height: 12px;
font-weight: bold;
color: #CCCCCC;
}
title {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 20px;
font-weight: bold;
color: #FFFFFF;
}
small {
font-size: 9px;
color: #666666;
}
.green {
color: #99CC66
}
big {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 20px;
font-weight: bold;
color: #FFFFFF;
text-decoration: none;
}
strong {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
line-height: 12px;
font-weight: bold;
color: #FFFFFF;
}
.small {
font-size: 9px;
color: #666666;
}
////////////////////////////////////////
any suggestions welcomed..Make sure that your page passes the Validator (<!-- m --><a class="postlink" href="http://validator.w3.org/">http://validator.w3.org/</a><!-- m -->) with no errors and I bet that your problem disappears.Just to back up what Charles is saying. The <title> tag should be used once within the <head> tag. What is in the <title> tag is what you see at the very top left of your browser. It sounds more like you want to use something like a <h1>, <h2>, <h3>, etc. tag instead.cool. thank u
however.. if i use h1, h2 etc to format a particular word then it also formats the entire paragraph... this is not so useful for me
do u know which tags i can rededine without causing complications?
so far i have used:
<b>
<strong>
<big>
<small>
what about <blockquotes>? should that only be used in specific situations?try using h1 with it's corresponding /h1 tag:
<h1>Title</h1>
If you close all your elements as appropriate, then you won't have any problems with styles carrying over.Originally posted by schlarto
what about <blockquotes>? should that only be used in specific situations? All elements should be used in specific situations. BLOCKQUOTE is for block quotations. P is for paragraphs. The H elements are for headings.
We're talking here about separating content from presentation. If you mark up the content and meaning of your page then it will make sense no matter how it is presented. Keep in mind Braille and audio browsers.
If it's a heading but you don't want it as a block element then use something like:
<h4 style="display:inline">My Happy Heading</h4>
Always start with a page in HTML 4.01 Strict and then add the presentation with CSS.ok, looks like i was being a dumbass.. using <h1> tags correctly makes all the difference.
thanks for your help ;-)doh...i just realised why the <h> tags aren't ideal...
they appear to automatically create a new paragraph after them
being a picky designer i want only a <br> new line rather than a full gap before the next text... is there a get around for this?<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled</title>
<style type="text/css">
<!--
h1 {
margin-bottom: 0px;
}
-->
</style>
</head>
<body>
<h1>Hello</h1>
Hi
</body>
</html>...and if you don't want the extra space on the top, use margin: 0; rather than just margin-bottom...brilliant
thank youah.. hello again...
is there a way of actually disabling the line break after a <h1> tag so u can put other text on the same line?Charles mentioned it earlier - display:inline;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled</title>
<style type="text/css">
<!--
h1 {
display: inline;
margin-bottom: 0px;
}
-->
</style>
</head>
<body>
<h1>Hello</h1>
Hi
</body>
</html>With display: inline;, you don't need margin-bottom: 0;...Originally posted by pyro
With display: inline;, you don't need margin-bottom: 0;... But with HTML 4.01 Strict the BODY element cannot directly contain PCDATA or inline elements.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Example</title>
<style type="text/css">
<!--
h1 {display:inline; float:left}
-->
</style>
<h1>Mi specisca amecer</h1>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipitlobortis nisl ut aliquip ex ea commodo consequat.</p> yeah I know. I just pasted the line in and it works.
Just out of interest charles, why do you seem to do all of your coding these days without body tags etc?
Oddly enough if you just paste it into the wdg validator and add a p tag around the hi it's valid <!-- m --><a class="postlink" href="http://www.htmlhelp.org/cgi-bin/validate.cgiOriginally">http://www.htmlhelp.org/cgi-bin/validate.cgiOriginally</a><!-- m --> posted by DaveSW
Just out of interest charles, why do you seem to do all of your coding these days without body tags etc?I'm trying to keep my postings as short as possible while maintaining validity. In HTML both the start and end tags for the HTML, HEAD and BODY elements are optional.Some of the tags I use to redefine are <em> <I> <U> then you can add them where you want with not much of a problem just don't forget the closing tags.