June 10, 201016 yr Hey. Sorry for asking something that is probably daft to many of you but i have only just moved onto raw coding rather than using dreamweaver so im very rusty now. I simply cannot get my html page to link to my .css file unless i write in inside the html file itself rther than having the seperate .css file. Where am i going wrong? wrapper.css #wrapper { width: 1024px; height: 1000px; background-image: url('images/home_theme.png'); } index.html <!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" xml:lang="en" lang="en"> <head> <title></title> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <meta name="description" content="" /> <meta name="keywords" content="" /> <link href="css/wrapper.css" rel="stylesheet" type="text/css"></link> </head> <body> <div id="wrapper"></div> </body> </html> Thank you
June 10, 201016 yr Assuming that your wrapper.css file is located in the /css folder, the only issue is: <link href="css/wrapper.css" rel="stylesheet" type="text/css"></link> Should be: <link href="css/wrapper.css" rel="stylesheet" type="text/css" media="screen" />
June 10, 201016 yr Author Assuming that your wrapper.css file is located in the /css folder, the only issue is: <link href="css/wrapper.css" rel="stylesheet" type="text/css"></link> Should be: <link href="css/wrapper.css" rel="stylesheet" type="text/css" media="screen" /> Well iv changed the code exactly how you typed it but still will not atatch. What is wrong?
June 10, 201016 yr It's more than likely that wrapper.css is not located in the /css folder which is relative to your HTML file.
June 10, 201016 yr Author Iv fugured it out. Image paths in css are relative to the style sheet, not the html. This is the code that finaly did it for me background-image: url('../images/home_theme.png'); Thanks for trying though
Create an account or sign in to comment