Jump to content

Linking style to html code


Chikwado

Recommended Posts

where's the code relative to the HTML? If you included it incorrectly due to the path, you would see a 404 in your browsers error console. otherwise, maybe the CSS is wrong and we would have to see the HTML / CSS for that.

Link to comment
Share on other sites

Yes, I made my code like this: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>my external stylesheet page</title> <link rel="stylesheet" type="text/css" href="mystyle.css" media="all"> body{magin:0 auto; padding:0; width:100%; background:#000FFF;} </head> <body> <h1>external style test</h1> <p>very grateful for any help</p> </body> </html> And I saved it with extension .css, When I Click the browser to read it, It show only css properties and html text. Any help please.

Link to comment
Share on other sites

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>my external stylesheet page</title> <link rel="stylesheet" type="text/css" href="mystyle.css" media="all"> body{magin:0 auto; padding:0; width:100%; background:#000FFF;} </head> <body> <h1>external style test</h1> <p>very grateful for any help</p> </body> </html>Err... You saved THIS with extension css? Then thats your problem.Save this as html without css styling, NOT CSS LINK, save css ONLY without style tag with css extension, the link to css file is made from html document by this.<link rel="stylesheet" type="text/css" href="mystyle.css" media="all">

Edited by dsonesuk
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...