<link href="home_page_style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
p.leftmargin {margin-left: 2cm}
</style>
Please can someone tell me the correct syntax of defining a class.
I am new to css.
correct syntax for defining class in html
correct syntax for defining class in html
You're best off checking out some of the css tutorials.
e.g.
www.w3schools.com
www.htmldog.com
checked wc3 , that is where l got syntx from!
correct syntax for defining class in html
it's correct. is that what you wanted? you can use either link, or style, or import within style, or inline style, or a combination of any or all.
correct syntax for defining class in html
it's correct. is that what you wanted? you can use either link, or style, or import within style, or inline style, or a combination of any or all.
Yes, but for some reason it is not working, see coding:
<style type="text/css">
p.leftmargin {margin-left: 5cm}
</style>
</head>
<body>
<div id="wrapper">
<div id="header"></div>
<div id="navcontainer">
<ul>
<li> <a href="index.htm">Home</a> </li>
<li> <a href="faq.htm">FAQ's</a> </li>
<li> <a href="links.htm">Links</a> </li>
<li> <a href="feb.html">Calendar</a></li>
<li> <a href="contact.html" id="last">Contact</A>
</ul>
</div>
<div id="content">
<div id="rightcol">
<h1>Introduction</h1>
<p class="leftmargin">This is a paragraph with a specified left margin</p>[img][/img]
correct syntax for defining class in html
what is it doing?
correct syntax for defining class in html
what is it doing?
For some reason the text is not being indented.
see screenshot for what l mean.
[/img]
correct syntax for defining class in html
It works for me. Show a link.
correct syntax for defining class in html
Show us a link to the site.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <style type="text/css"> p.leftmargin {margin-left: 5cm; background: pink;} </style> </head> <body> <div id="wrapper"> <div id="header"></div> <div id="navcontainer"> <ul> <li> <a href="index.htm">Home</a> </li> <li> <a href="faq.htm">FAQ's</a> </li> <li> <a href="links.htm">Links</a> </li> <li> <a href="feb.html">Calendar</a></li> <li> <a href="contact.html" id="last">Contact</A> </ul> </div> <div id="content"> <div id="rightcol"> <h1>Introduction</h1> <p class="leftmargin">This is a paragraph with a specified left margin</p> </div> </div> </body> </html>
works fine for me.
correct syntax for defining class in html
Show us a link to the site.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <style type="text/css"> p.leftmargin {margin-left: 5cm; background: pink;} </style> </head> <body> <div id="wrapper"> <div id="header"></div> <div id="navcontainer"> <ul> <li> <a href="index.htm">Home</a> </li> <li> <a href="faq.htm">FAQ's</a> </li> <li> <a href="links.htm">Links</a> </li> <li> <a href="feb.html">Calendar</a></li> <li> <a href="contact.html" id="last">Contact</A> </ul> </div> <div id="content"> <div id="rightcol"> <h1>Introduction</h1> <p class="leftmargin">This is a paragraph with a specified left margin</p> </div> </div> </body> </html>
works fine for me.
The text is not indenting from the left still though, any ideas?
Can you show me a screenshot of it working please.
correct syntax for defining class in html
correct syntax for defining class in html
Clubamigos, it sounds like there may be other style rules with higher specificity impacting on that part of your html.
Get FF, Web developer. Use CSS / View Style Information and click on the paragraph in question. That'll show you all the style rules that are firing. You can then see if there is another overriding your .leftmargin class.
correct syntax for defining class in html
This is the CSs l am currently using:
I think the problem is due to the fact that you pointed in that l have 2 style sheets and it is using the first style sheet.I would like to use the first style sheet but only the p.leftmargin formatting of the second style sheet.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>A social club for people to go and have a good time and try new activities</title>
<meta name="keywords" content="social clubs southampton,clubs southampton,single events hampshire,new friends hampshire,new friends southampton,looking new friends,meeting new people,social clubs south coast,looking friendship uk,social clubs UK">
<meta name="description" content="A social club for people to go out enjoy themselves and try new activites">
<meta name="robots" content="index,follow">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="home_page_style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
p.leftmargin {margin-left: 25%}
</style>
</head>
<body>
<div id="wrapper">
<div id="header"></div>
<div id="navcontainer">
<ul>
<li> <a href="index.htm">Home</a> </li>
<li> <a href="faq.htm">FAQ's</a> </li>
<li> <a href="links.htm">Links</a> </li>
<li> <a href="feb.html">Calendar</a></li>
<li> <a href="contact.html" id="last">Contact</A>
</ul>
</div>
<div id="content">
<div id="rightcol">
<h1>Introduction</h1>
<p class="leftmargin">This is a paragraph with a specified left margin</p>
<p><font face="Verdana, Arial, Helvetica, sans-serif">Looking to meet new people and go out and have a good time?</font><br/>
<p><font face="Verdana, Arial, Helvetica, sans-serif">Then why not try Club Amigos?</font><br/>
<p> </p>
<table width="64%" border="0" align="center">
<tr>
<td width="41%"><img src="frontpage_members1.jpg" width="165" height="110" border="0" /></td>
<td width="39%"><img src="frontpage_members2.gif" width="164" height="110" border="0" /></td>
<td width="39%"><img src="frontpage_members3.gif" width="108" height="110" border="0" /></td>
<td width="20%"><img src="frontpage_members4.jpg" border="0" /></td>
</tr>
</table>
<p> </p>
<p><font size="2" face="Verdana, Arial, Helvetica, sans-serif">A social club based in Southampton, UK which welcomes anyone from the ages of 20 to 40.</font></p>
<p><font size="2" face="Verdana, Arial, Helvetica, sans-serif">The club was formed in late 2005 and has even numbers of men and women.</font></p>
<p><font size="2" face="Verdana, Arial, Helvetica, sans-serif">The idea of the club came about as a way for people to go out and enjoy themselves.</font></p>
<p><font size="2" face="Verdana, Arial, Helvetica, sans-serif">We meet every Thursday at Bar Risa in Above Bar Street, Southampton at around 8.30pm.</font></p>
<p><font size="2" face="Verdana, Arial, Helvetica, sans-serif">See full <a href="map_details.html" TARGET="_self">map details</a></font>.</p>
<p> </p>
<p> </p>
<div id="footer">Site designed by JJR , Email </div>
</div>
</div>
</body>
</html>
correct syntax for defining class in html
This is the CSs l am currently using:
Show. A. Link.
correct syntax for defining class in html
please tell me those aren't font tags I see
and nonbreaking spaces used for positioning
the code you just posted works fine here in Safari and Firefox 1.5. What browser are you using?
correct syntax for defining class in html
please tell me those aren't font tags I see![]()
and nonbreaking spaces used for positioning![]()
the code you just posted works fine here in Safari and Firefox 1.5. What browser are you using?
yes they are!
Whoops!
I managed to resolve this issue by validating my code.
correct syntax for defining class in html
I managed to resolve this issue by validating my code.
We could have told you that a long time ago had you presented a link at the first request.