This is the whole document:
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Title</title>
<style type="text/css">
body {
font-family: Tahoma;
font-size: 8px;
background: #f00;
}
</style>
</head>
<body>
Sample Text
<p>Another Text</p>
</body>
</html>
And in jsfiddle: http://jsfiddle.net/HDBqZ/
Why it's not working? Am I missing something?
Type Selectors correspond with HTML elements. ID Selectors are used by adding # in front of an elements ID. Class Selectors are used by adding a period in front of an elements class.
If you put the <link> tag inside another valid header tag like <title> or <script> tag, then the CSS won't work. The external style CAN be put inside the <body> tag, although it's recommended to put it in the <head> tag to load the style before the page content.
A Type Selector (sometimes referred to as an Element Type Selector) matches elements with the corresponding element node name, such as <p>, <span> , and <div> tags. Type selectors are generally used to make “broad stroke” changes to the style of a site.
The element selector is a way to select all the elements with a given tag name in a document, and apply the same styles to each element with the tag name. Note that you should only write the tag name, and not write brackets around the tag name — h1 , not <h1> . 2.
There seems to be some junk after the y
in your body {
selector:
>>> u'body'
u'body\u200c'
Delete your body
line and re-write it by hand. Your text editor should have some tool to get rid of these things automatically as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With