I am using border-radius for buttons throughout a page that I am developing. In IE8 since the border radius isn't supported, the buttons show up as rectangles instead of rounded rectangles. To help rectify this, I've added a background image in hopes for it to fallback to it in the case of when it is IE8. This seems to pose two problems:
1) It doesn't fall back to the image, the background-color seems to still override the image
2) In newer browser versions of Chrome, etc, it doesn't show the border-radius, it defaults to the background image.
See this fiddle for CSS for Chrome/Safari/Firefox: http://jsfiddle.net/s33Mb/
<a href="download.html" class="download-button">
<div class="now">DOWNLOAD NOW</div>
<div class="arrow-right"></div>
</a>
.download-button {
background-color:#1c9aca;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
position: absolute;
width: 133px;
height: 25px;
text-decoration:none;
}
.now {
width:109px;
position:absolute;
font-family:Arial;
font-size:12px;
font-weight:bold;
position:absolute;
bottom: 5px;
left: 18px;
color:#ffffff;
}
.arrow-right {
width: 0px;
height: 0px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid #fff;
position: absolute;
bottom: 7px;
left: 8px;
}
Fiddle attempt for IE: http://jsfiddle.net/MZ72w/ - which you can see in chrome/safari/firefox it is only showing the background image now, but in IE it shows a square rectangle.
In my header I also have:
<!--[if IE 9]> <link href="css/ie9.css" rel="stylesheet" type="text/css" /> <![endif]-->
<!--[if IE 8]> <link href="css/ie8.css" rel="stylesheet" type="text/css" /> <![endif]-->
<!--[if IE 7]> <link href="css/ie7.css" rel="stylesheet" type="text/css" /> <![endif]-->
I have tried to add the download-now selector to these style sheets, but IE doesn't seem to list. Any light on either of these subjects would be great!
Related
Im creating a simple webpage. My CSS is only working in Chrome. It doesnt work in both Firefox and IE11.
Here's my HTML
<html>
<head>
<title>text</title>
<link href="css/stylesheet.css" type="css/stylesheet" rel="stylesheet" media="all"/>
</head>
<body>
<h1><b><u>Adding a new Visitor</u></b></h1><br/></br>
<div class="wrapper">
<figure>
<img src="images/advis1.png"/>
<figcaption style="padding-top: 12px;">text</figcaption>
</figure>
<hr/>
<figure>
<img src="images/advis2.png"/>
<figcaption style="padding-top: 12px;">text</figcaption>
</figure>
<hr/>
<figure>
<img src="images/advis3.png"/>
<figcaption style="padding-top: 12px;">text.</figcaption>
</figure>
<hr/>
<h3><u>Result</u></h3>
<img src="images/advis4.png"/>
<br/>
<img src="images/advis5.png"/>
</div>
<footer>
Author: Malcolm Tanti | Contact information: xxxxm
</footer>
</body>
And here is my CSS
h1 {
text-align: center;
border-bottom: double;
border-left: double;
border-right: double;
width: 75%;
margin: 0 auto;
padding-top: 25px;
padding-bottom: 25px;
background-color: #C4CEDD;
box-shadow: inset 0 20px 20px -20px #000000;
}
body {
padding:0px;
margin:0px;
border:none;
background-color: #7ea2d6;
font-family: "Arial Rounded MT Bold", "Helvetica Rounded", Arial, sans-serif;
}
.wrapper {
box-shadow: inset 0 20px 20px -20px #000000;
border: double;
padding-top: 50px;
padding-bottom:50px;
width: 75%;
margin: 0 auto;
text-align: center;
font-size: 20px;
background-color: #C4CEDD;
}
img {
border:3px double;
display: block;
margin: 0 auto;
}
footer {
padding-top: 10px;
text-align: center;
font-size: 14px;
}
I am quite new to CSS but and HTML. It works prefectly fine in Chrome which leads me to wonder what the problem is. My Problem is that none of the css loads and that all images and text are not aligned. I do not even have anycolours
I tested your code and found that if you remove type="css/stylesheet" from:
<link href="css/stylesheet.css" type="css/stylesheet" rel="stylesheet" media="all"/>
so it looks like:
<link href="css/stylesheet.css" rel="stylesheet" media="all">
You also don't need the closing / at the end.
It fixes the issue. (Tested on standards mode not quirks)
And you shouldn't need to do this:
<h1><b><u>Adding a new Visitor</u></b></h1><br/></br>
The underline, font-weight and spacing (margin/padding) should be done in your CSS:
<h1>Adding a new Visitor</h1>
h1 {
text-align: center;
border-bottom: double;
border-left: double;
border-right: double;
width: 75%;
margin: 0 auto;
padding-top: 25px;
padding-bottom: 25px;
background-color: #C4CEDD;
box-shadow: inset 0 20px 20px -20px #000000;
text-decoration: underline;
font-weight: bold;
}
Hope that helps.
Solved by using type="text/css" instead of type="css/stylesheet" when importing the stylesheet.
for internet explorer add this
<!--[if lt IE 9]
< script src = "//html5shiv.googlecode.com/svn/trunk/html5.js" > < /script>
<![endif]-->
It can be because of browser cache. Please clear browser cache by CTRL + F5
I had the same problem and none of the above fixed my issue. In my case, in the end, the solution was simple:
Somehow IE doesn't load the CSS if you are running the page locally (as in stand-alone in your browser). I uploaded the exact same script to a webserver and it works like a charm!
msvk_23 is right.
I had a local html page, instead of post-it.
After I have installed Notepad++ it was all messed up in Internet Explorer and Edge, but not in Google Chrome.
When checking registry it said: text/xml
After changing this to text/css as suggested, it worked immediately in both Internet Explorer and Edge.
Thanks msvk_23 :)
pic of regedit
Try this option:
Please run regedit.exe and navigate to the key HKEY_LOCAL_MACHINE\SOFTWARE\Classes.css
Modify: "Content Type" from "text/plain" to "text/css"
For me the css was not at all recognizing in IE 11. By changing this entry in regedit. It perfectly worked in my PC.
:-)
Smiley - face at the start there, but this is really irritating for me.
As you see from the title, THE POSITIONING OF THE ELEMENTS IN IE 6,7 AND 8(At least) is off. I'm including the direct url : http://evolvedtools.com/Genr8Mobi.html.
Now this page is normally a redirect from a full - size page, and on a reasonable browser (Read: everything bar Internet explorer) ,everything renders well. The page is meant for small format browser or mobile, but it has css for desktop also in separate stylesheet. Resize your browser window to see how it works.
Here's the html:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Genr8</title>
<!--[if lt IE 9]>
<link href="PuzzleMobileIE.css" rel="stylesheet" type="text/css" media="screen and (max-width: 649px), screen and (max-width: 767px) and (min-device-height:320px)" id="stylesheet-PIEmob" >
<link href="DesktopIE.css" rel="stylesheet" type="text/css" media="screen and (min-width: 651px) and (min-height: 650px)" id="stylesheet-DTIE" >
<![endif]-->
<link href="PuzzleMobile.css" rel="stylesheet" type="text/css" media="screen and (max-width: 649px), screen and (max-width: 767px) and (min-device-height:320px)" id="stylesheet-Pmob" >
<link href="PuzzlePad.css" rel="stylesheet" type="text/css" media="screen and (min-width: 650px) and (max-width: 1024px)" id="stylesheet-Pad" >
<link href="Desktop.css" rel="stylesheet" type="text/css" media="screen and (min-width: 651px) and (min-height: 650px)" id="stylesheet-DT" >
<Script type="text/javascript" src="Scripts/js/Respond/Respond-master/dest/respond.min.js"></Script>
<Script type="text/javascript" src="Javascript Cookie Script.js"></Script>
<!--<Script type="text/javascript" src="Scripts/js/css3-mediaqueries.js"></script>-->
<script type="text/javascript">
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
</script>
</head>
<body onload="MM_preloadImages('images/puzPlugin_56.png','images/HomeButton_03.png','images/AnimasjonMotsatt.gif','images/puzzleGenr8SpriteFull.png','images/Spritepuz1.png')">
<div class="puzzle">
<div class="puzzle2">
<div id="homeGenr8"><img src="images/HomeButton_03.png" alt="HomeG8MobAlt" name="homeGenr8" width="100%" id="homeGenr82" ></div>
<div id="Genr8Flash"><img src="images/AnimasjonMotsatt.gif" alt="FlashG8MobAlt" name="Genr8Flash" width="100%" id="Genr8Flash2" ></div>
<div id="puzzleK"><img src="images/puzPlugin_56.png" alt="PluginsG8Alt" name="puzzleK" width="100%" class="AllElements" id="puzzleK2" ></div>
</div>
<ul id="navlist">
<li id="Intro"></li>
<li id="Source"></li>
</ul>
<ul id="navlist2">
<li id="genr82001"></li>
<li id="compDebug"></li>
</ul>
<ul id="navlist3">
<li id="pWorkings"></li>
</ul>
<ul id="navlist4">
<li id="analysis"></li>
</ul>
<ul id="navlist5">
<li id="g8new"></li>
</ul>
</div>
<Script type="text/javascript" src="BodyScriptGenr8.js"></Script>
</body>
</html>
As you can see from the header, I have tried to include a separate stylesheet for IE8 and lower, but there seems to be no difference. I am using IETester with debugbar to test.
I have tried to change everything in the css, but nothing registers. THE MAIN question though remains: Why o why will the sprites not position right with older IE ?
css for the "mobile" or small windowed desktop:
#charset "utf-8";
/* CSS Document */
#media screen and (max-width: 649px), screen and (max-width: 767px) and (min-device-height:320px){
body {
background-color: #000!important;
}
a:link {
text-decoration: #000;
}
a:visited {
text-decoration: #000;
}
a:hover {
text-decoration: #000;
}
a:active {
text-decoration: #000;
}
img {
border:0;
}
.puzzle {
display: block;
position: absolute;
width:290px;
height:282px;
margin-left: -145px;
margin-top: -141px;
/*margin-left: auto;*/
/*left: auto;
top: auto;*/
top: 50%;
left: 50%;
background-image: url(images/puzzleGenr8SpriteFullMob.png);
/*_background-image: url(images/puzzleGenr8SpriteFullMob.gif);*/ /*IE6*/
background-size:290px 282px!important;
background-position: 0px 0px;
z-index: 1;
background-repeat: no-repeat;
}
.puzzle2 {
position: relative;
z-index: 2;
display:block;
background-color: #000!important;
}
#homeGenr8 {
display: block;
position: absolute;
height: 28px;
width: 69px;
left: 0px;
top: 0px;
visibility: visible;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
}
/*html>body #homeGenr8
{
width: auto;
height: auto;
min-width: 69px;
min-height: 28px;
}
*/
#Genr8Flash {
display: block;
position: absolute;
height: 28px;
width: 62px;
top: 0px;
left: 228px;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
}
#puzzleK {
display: block;
position: absolute;
visibility: visible;
height: 28px;
width: 63px;
left: 227px;
top: 254px;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
}
#navlist{position:relative;}
#navlist li{margin:0;padding:0;list-style:none;position:absolute;top:-8px;}
#navlist li, #navlist a{height:23px;display:block;}
/*#backG{left:0px;width:580px;height:563px;}
#backG{background:url('images/puzzleGenr8SpriteFull.png') 0 0;}*/
#Intro{left:85px;width:50px;height:23px;}
#Intro{background:url('images/puzzleGenr8SpriteFull.png') -83px -5px;background-size: 290px 282px; background-repeat:no-repeat;}
#Intro a:hover{background: url('images/Spritepuz1Mob.gif') -83px -5px;
background-size: 290px 282px; background-repeat:no-repeat;}
#Source{left:152px;width:58px;height:14px;}
#Source{background:url('images/puzzleGenr8SpriteFull.png') -152px -8px;
background-size: 290px 282px; background-repeat:no-repeat;}
#Source a:hover{background: url('images/Spritepuz1Mob.gif') -152px -8px;
background-size: 290px 282px; background-repeat:no-repeat;}
#navlist2{position:relative;}
#navlist2 li{margin:0;padding:0;list-style:none;position:absolute;top:22px;}
#navlist2 li, #navlist2 a{height:28px;display:block;}
#genr82001{left:31px;width:50px;height:27px;}
#genr82001{background:url('images/puzzleGenr8SpriteFull.png') -28px -38px;
background-size: 290px 282px; background-repeat:no-repeat;}
#genr82001 a:hover{background: url('images/Spritepuz1.gif') -28px -38px;
background-size: 290px 282px; background-repeat:no-repeat;}
#compDebug{left:220px;width:60px;height:20px;}
#compDebug{background:url('images/puzzleGenr8SpriteFull.png') -220px -38px;
background-size: 290px 282px; background-repeat:no-repeat;}
#compDebug a:hover{background: url('images/Spritepuz1Mob.gif') -220px -38px;
background-size: 290px 282px; background-repeat:no-repeat;}
#navlist3{position:relative;}
#navlist3 li{margin:0;padding:0;list-style:none;position:absolute;top:63px;}
#navlist3 li, #navlist3 a{height:23px;display:block;}
#pWorkings{left:147px;width:55px;height:23px;}
#pWorkings{background:url('images/puzzleGenr8SpriteFull.png') -147px -75px;
background-size: 290px 282px; background-repeat:no-repeat;}
#pWorkings a:hover{background: url('images/Spritepuz1Mob.gif') -147px -75px;
background-size: 290px 282px; background-repeat:no-repeat;}
#navlist4{position:relative;}
#navlist4 li{margin:0;padding:0;list-style:none;position:absolute;top:105px;}
#navlist4 li, #navlist4 a{height:27px;display:block;}
#analysis{left:25px;width:53px;height:23px;}
#analysis{background:url('images/puzzleGenr8SpriteFull.png') -20px -120px;
background-size: 290px 282px; background-repeat:no-repeat;}
#analysis a:hover{background: url('images/Spritepuz1Mob.gif') -20px -120px;
background-size: 290px 282px; background-repeat:no-repeat;}
#navlist5{position:relative;}
#navlist5 li{margin:0;padding:0;list-style:none;position:absolute;top:221px;}
#navlist5 li, #navlist5 a{height:27px;display:block;}
#g8new{left:12px;width:55px;height:23px;}
#g8new{background:url('images/puzzleGenr8SpriteFull.png') -7px -232px;
background-size: 290px 282px; background-repeat:no-repeat;}
#g8new a:hover{background: url('images/Spritepuz1Mob.gif') -7px -232px;
background-size: 290px 282px; background-repeat:no-repeat;}
}
I get warnings for background-size in the css-file, but how would I go about correcting my css/html for this to display correctly in IE6,7 and 8 ?
Just to be clear - I am not going to change all my html and css just for the page to display with old IE, but I would really appreciate a little insight :-)
#media is not supported by IE8 or earlier. All your CSS code is inside an #media block, and thus won't be seen by these browsers.
You can use a polyfill like respond.js to handle this which will probably help (although I can't vouch for the performance if you need to support browsers as old as IE8).
But to be honest most of that CSS code shouldn't be inside an #media block anyway; media blocks should contain only the styles which you want to be different from normal for a given screen size. Everything that's the same as normal should be kept outside of the media block.
If you just do that, there's a good chance that you may not even need to worry about respond.js if you can get the default CSS outside of the media blocks to be how you want IE6/7/8 to behave; then the media blocks can just be for overrides for browsers in different sized windows to that.
[EDIT]
You've edited the question, and I now see that you're already using respond.js, so hopefully this means that the above is not the main issue. I still think you need to reduce the size of your media query code though; there's a lot of CSS in there which really shouldn't be in a media query.
The other problem you've got is that you're using background-size for your sprite image.
This is another CSS feature that is not supported by IE8 and earlier, and this will definitely break your sprites. In fact it weakens the whole concept of using background images for sprites in IE8.
Again, there are polyfills for this feature, you can you get it working in IE8 if you're determined. See here for links to a few possible options. I usually recommend CSS3Pie for this kind of thing, but as you can see it's not the only option, so pick the one that works best for you.
Always bear in mind that the more polyfill scripts you use, and the more you're asking them to do, the more of a performance impact it'll have.
#skiptrace {
border-top: #FFFFFF;
border-left: #FFFFFF;
border-right: #FFFFFF;
border-bottom: #FFFFFF;
width: 731px;
height: 900px;
}
the border still appears on my div below in IE.
I'm trying to incorporate
<!--[if IE]><style type="text/css">.pie, #skiptrace {behavior:url(PIE.htc);}</style><![endif]-->
<!--[if IE 7]><html class="ie7 oldie"> <![endif]-->
from this website.. which is pretty nice http://css3pie.com/
<div id="skiptrace">
<iframe name="my_iframe" src="" id="skiptrace"></iframe>
</div>
Try using it this way:
<style type="text/css">
#skiptrace {
border:1px solid #FFF;
behavior:url(PIE.htc);
}
</style>
NOTE: PIE.htc is relative to document not the CSS file.
I am trying to implement a rounded corner to a box in my html code.
When I run the file on Chrome, I have the box and all the attribute but the corners won't round.
I am using Komodo Edit on MAC OSX Lion.
What's the solution?
Thanks
<!doctype html>
<html lang="en">
<head>
<meta charset=="utf-8" />
<link rel="stylesheet" href="new.css" />
</head>
<body>
<div id="box">
<p id="text"> Hello </p>
</div>
</body>
</html>
CSS3:
body {
text-align:center;
}
#box {
display: block;
width: 500px;
margin:50px auto ;
padding:15px ;
text-align:center;
border: 1px solid blue;
background: red;
-webkit-border-radius: 25p;
}
#text {
font:bold 100px Century Gothic;
}
The problem is probably that it should be 25px instead of 25p.
But depending on you Chrome version, you should drop the -webkit- and just use border-radius;
You don't need -webkit- on there. Just use border-radius.
The main problem is that you missed the x on 25px.
Looks like a typo
-webkit-border-radius: 25p;
Should be
-webkit-border-radius: 25px;
You missed an x on the end. For cross browser compliancey, you should really use several prefixes.
-moz-border-radius: 25px; /*Firefox*/
-webkit-border-radius: 25px; /*Safari/Chrome/Konqueror*/
-khtml-border-radius: 25px; /*Konqueror*/
border-radius: 25px; /*Chrome*/
I am beginning to make my first website and I so far have a menu and all but the problem is I don't know how to use an external css for formatting....
What I mean by that is, I DO KNOW in an external css if I put body { background-color: yellow} and use <link rel="stylesheet" type="text/css" href="style1.css" /> it will apply yellow to background color of my website.
What I can't figure out is how can I use a css file to apply the menu and fonts to all of the web pages I make....I don't want to post this same css code in every web page as the tutorial I am following says it is good programming to just import a css file into all the web pages you want to apply the format to instead of pasting that css code into each and every one....
Here is my code, basically what I want to know is how can I put the css part of the code into a css file so I can call it for all my web pages instead of putting it into my code directly, beware the css changes according to what browser you are using for blur etc.
In short: What will my CSS file look like and what will my htm file look like for code?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Blurry Menu</title>
<style type="text/css">
body {
background: #1a1a1a url(bg.jpg);
}
#blur {
position: relative;
top: 50px;
width: 100%;
border: 2px solid #000000;
border-style: solid none;
}
#blur:before {
position: absolute;
top: 0px;
width: 100%;
height: 100%;
border-top: 2px solid #212121;
content: '';
}
#blur:after {
position: absolute;
width: 100%;
height: 100%;
top: 1px;
border-bottom: 2px solid #212121;
content: '';
}
#blur ul {
position: relative;
top: 0;
width: 960px;
margin: 0 auto;
list-style-type: none;
overflow: hidden;
}
#blur li {
float: left;
position: relative;
}
#blur a {
position: relative;
float: left;
padding: 20px 25px;
margin-left: 10px;
text-decoration: none;
font-family: "trebuchet ms";
font-variant: small-caps;
color: transparent;
text-shadow: 0 0 2px #cacaca;
z-index: 100;
}
/* normal styles */
#blur a:hover, #blur a:focus {
color: #ffffca;
text-shadow: 0 0 0 transparent;
}
/* active styles */
#blur .active a, #blur .active a:hover {
color: #cacaca;
text-shadow: 0 0 2px #cacaca;
}
</style>
<!--[if IE]>
<style type="text/css">
#blur {
-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(color=#212121,direction=180,strength=0)";
filter: progid:DXImageTransform.Microsoft.Shadow(color=#212121,direction=180,strength=0);
}
#blur ul li a {
color: #ffffca;
-ms-filter: "progid:DXImageTransform.Microsoft.Blur()";
filter: progid:DXImageTransform.Microsoft.Blur();
}
#blur ul a:hover, #blur ul .active a, #blur ul a:focus {
position: relative;
margin: 2px 0 -10px 10px;
-ms-filter: "progid:DXImageTransform.Microsoft.Blur(enabled = false)";
filter: progid:DXImageTransform.Microsoft.Blur(enabled = false);
}
</style>
<![endif]-->
<!--[if lt IE 8]>
<style type="text/css">
#blur ul a:hover, #blur ul .active a {
position: relative;
margin: 2px 4px 0 10px;
filter: progid:DXImageTransform.Microsoft.Blur(enabled = false);
}
</style>
<![endif]-->
</head>
<body>
<div id="blur">
<ul>
<li>
Home
</li>
<li>
How-to
</li>
<li class="active">
Edit
</li>
<li>
Features
</li>
<li>
Services
</li>
<li>
Contact
</li>
</ul>
</div>
</body>
</html>
Place your style sheet within your header, e.g.
<head>
<title>My Awesome Site</title>
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
...with the href referencing the location of your style sheet. Then you may apply the style sheet rules the same as if you had an internal stylesheet.
When you create your external style sheet, just remember, don't include <style> tags inside of the document itself.
Move your CSS to a new file, say, "style.css" and import the stylesheet in your webpages. To do this, add the following tag to the HEAD section of your HTML:
<LINK REL=StyleSheet HREF="style.css" TYPE="text/css" MEDIA=screen>
For more details, I recommend you go through this page.
http://www.tizag.com/cssT/external.php. Will tell you how.
<link rel="stylesheet" type="text/css" href="theme.css" />
Is what you want. I suggest reading over http://www.w3schools.com/css/default.asp for basics.
A simple way is
<link rel="stylesheet" href="/css/master.css" type="text/css" media=">
This needs to be placed in the head section of you page.
The href references the path to the file.
You can also use the #import method.
<style type="text/css">
#import url("/css/master.css");
</style>
Put your inline styles in a document and name it with the extension .css. Then reference it between your tags with the following line.
<link rel="stylesheet" href="path/to/file.css" type="text/css" />
The href can be both relative (../images/file.css) or absolute (/images/file.css).
If you need to access different media, you can put in a media tag (like media="screen") or media="print" for stylesheet only to be used when printing a page.
As the html5 evolved you can declare ur document type <!doctype> and utilise the external css
by placing all the css in a file named style.css and then u can acess it with
<link rel="stylesheet" href="path/to/file.css"/>
and embed ur css into your website
NOTE:In html5 type is optional