Can someone please explain HTML tags and CSS styles and how to use them with External Stylesheets?
i've never used external style sheet before , know need learn, trying now. i've linked page etc, don't understand why html tags aren't working... can put css styles in there? can explain best practices here? many indeed.
css can used in 3 ways:
1. inline
2. embedded
3. linked external stylesheet
an example of inline styling - <p style="color:red;">this text red</p>. least desirable method of 3 since has embedded presentational information within content (which counter mantra important in web development separate presentation content). example result in 1 paragraph's content being styled red.
an example of embedded styling -
<!doctype html>
<html>
<head>
<title>embedded styling</title>
<style type="text-css">
p { color:red; }
</style>
</head>
<body>
<p>this text red</p>
<p>so this</p>
</body>
</html>
this usage common. it's better approach inline styling since presentational information separate content, it's still not ideal since style information can affect document , no others in site.
an example of externally linked stylesheet -
<!doctype html>
<html>
<head>
<title>external styling</title>
<link rel="stylesheet" href="path_to_css_file.css" type="text/css">
</head>
<body>
<p>this text red</p>
<p>so this</p>
</body>
</html>
the externally linked css file (it can contain number of css rules, must not contain html) -
p { color:red; }
it's ideal since page in site can link file , styling benefit of of css rules within file.
does help?
More discussions in Dreamweaver support forum
adobe
Comments
Post a Comment