johnny0313x
02-24-2009, 04:42 AM
Okay, so I am working on redoing my portfolio site and have very little experience with css. I understand some of the basics and managed to make it this far with some instruction. So please go easy on the tech terms ha. Basically I am trying to make the site so that no matter what resolution or how wide your browser window is, things will adjust to fit correct. Problem is I can't get the menu to center without breaking it, and when you make the browser smaller the box at the top on the far right tends to get cut off rather then move with the layout(it moves a little then cuts) I have only tested it so far in firefox 3 for mac so it would probably best be viewed in that. Here is the code and link:
http://www.lyonsdesign.info/lyonsdesign/
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
<title>Lyonsdesign.info - John Lyons Portfolio site</title>
<meta http-equiv="Content-Language" content="en-us" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="MSSmartTagsPreventParsing" content="true" />
<meta name="description" content="John Lyons Online e-portfolio" />
<meta name="keywords" content="Portfolio, John Lyons, graphic design, digital art, illustrator, photoshop" />
<meta name="author" content="lyonsdesign.info" />
<style type="text/css" media="all">@import "master.css";</style>
</head>
<body>
<div id="page-container">
<div id="logo"><img src="images/logo.png"></div>
<div id="featured"><img src="images/featured.png"></div>
<div id="links">
<ul id="links">
<li><a id="print" href="index.html">Print<span></span></a></li>
<li><a id="portraits" href="pics.html">Portraits<span></span></a></li>
<li><a id="web" href="bn.html" title="Britnet Network">Web<span></span></a></li>
<li><a id="ads" href="forums.html">Ads<span></span></a></li>
<li><a id="all" href="lyrics.html">All<span></span></a></li>
<li><a id="resume" href="about.html">Resume<span></span></a></li>
<li><a id="me" href="about.html">About Me<span></span></a></li>
<li><a id="contact" href="about.html">Contact<span></span></a></li>
<li><a id="learn" href="about.html">Learn<span></span></a></li>
</ul>
</div>
<div id="content">Content</div>
<div id="footer">Footer</div>
</div>
</body>
</html>
CSS:
html, body {
margin: 0;
padding: 0;
background: #000000;
}
#page-container {
width: 100%;
margin: 0 0px;
background-color: #000000;
border-width: .1em;
border-style: solid;
border-color: #000000;
}
#logo {
float: left;
height: 307px;
width: 60%;
color: #fff;
background: #da0000 url(images/bg.gif) 0 0 repeat-x;
}
#featured {
float: right;
width: 40%;
height: 307px;
padding: 0 0px;
background: #da0000 url(images/bg.gif) 60% 0 repeat-x;
}
#featured h2 {
display: none;
text-align: right;
width: 337px;
margin-left: -5px;
font-size: 1.1em;
position: relative;
}
#links {
clear: both;
margin: 0 0;
min-height: 130px;
background: #c21c08 url(images/links.gif) 0 0 no-repeat;
font-size: 1pt;
}
* html #links {height: 130px;} /*sets a height for IE6, triggers haslayout*/
#links ul {
display: inline; /*pretty much only mentioned for IE to prevent stairstepping*/
}
#links a {
float: left;
margin: 0 0 0 0;
min-height: 130px;
color: #fff;
text-align: center;
font-size: 1.4em;
position: relative;
}
* html #links a {height: 130px;}
/*the below code is for those without images, to give visual feedback that they are indeed links*/
#links a:hover, #links a:focus {
text-decoration: none;
color: #ff0; /*yellow*/
outline: 0; /*this is acceptable because we are changing the image on :focus*/
}
#links a span {
position: absolute;
width: 100%; /*of parent, the anchor, whose widths we'll set below*/
height: 100%;
left: 0;
top: 0;
background: url(images/links.gif) 0 0 no-repeat;
}
#print {
width: 115px;
}
#print:focus span, #print:hover span {
background-position: 0 -130px; /*first number is horizontal, second is vertical*/
}
#portraits {
width: 102px;
}
#links #portraits span { /*because I said "#links a span, I need #links to override here*/
background-position: -115px 0;
}
#links #portraits:focus span, #links #portraits:hover span {
background-position: -115px -130px;
}
#web {
width: 102px;
}
#links #web span {
background-position: -217px 0px;
}
#links #web:focus span, #links #web:hover span {
background-position: -217px -130px;
}
#ads {
width: 103px;
}
#links #ads span {
background-position: -319px 0px;
}
#links #ads:focus span, #links #ads:hover span {
background-position: -319px -130px;
}
#all {
width: 96px;
}
#links #all span {
background-position: -422px 0px;
}
#links #all:focus span, #links #all:hover span {
background-position: -422px -130px;
}
#resume {
width: 103px;
}
#links #resume span {
background-position: -518px 0px;
}
#links #resume:focus span, #links #resume:hover span {
background-position: -518px -130px;
}
#me {
width: 110px;
}
#links #me span {
background-position: -621px 0px;
}
#links #me:focus span, #links #me:hover span {
background-position: -621px -130px;
}
#contact {
width: 114px;
}
#links #contact span {
background-position: -731px 0px;
}
#links #contact:focus span, #links #contact:hover span {
background-position: -731px -130px;
}
#learn {
width: 135px;
}
#links #learn span {
background-position: -845px 0px;
}
#links #learn:focus span, #links #learn:hover span {
background-position: -845px -130px;
}
#content {
background: #f6ddad;
height: 66px;
clear: both;
}
#footer {
background: #f6ddad;
height: 66px;
}
http://www.lyonsdesign.info/lyonsdesign/
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
<title>Lyonsdesign.info - John Lyons Portfolio site</title>
<meta http-equiv="Content-Language" content="en-us" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="MSSmartTagsPreventParsing" content="true" />
<meta name="description" content="John Lyons Online e-portfolio" />
<meta name="keywords" content="Portfolio, John Lyons, graphic design, digital art, illustrator, photoshop" />
<meta name="author" content="lyonsdesign.info" />
<style type="text/css" media="all">@import "master.css";</style>
</head>
<body>
<div id="page-container">
<div id="logo"><img src="images/logo.png"></div>
<div id="featured"><img src="images/featured.png"></div>
<div id="links">
<ul id="links">
<li><a id="print" href="index.html">Print<span></span></a></li>
<li><a id="portraits" href="pics.html">Portraits<span></span></a></li>
<li><a id="web" href="bn.html" title="Britnet Network">Web<span></span></a></li>
<li><a id="ads" href="forums.html">Ads<span></span></a></li>
<li><a id="all" href="lyrics.html">All<span></span></a></li>
<li><a id="resume" href="about.html">Resume<span></span></a></li>
<li><a id="me" href="about.html">About Me<span></span></a></li>
<li><a id="contact" href="about.html">Contact<span></span></a></li>
<li><a id="learn" href="about.html">Learn<span></span></a></li>
</ul>
</div>
<div id="content">Content</div>
<div id="footer">Footer</div>
</div>
</body>
</html>
CSS:
html, body {
margin: 0;
padding: 0;
background: #000000;
}
#page-container {
width: 100%;
margin: 0 0px;
background-color: #000000;
border-width: .1em;
border-style: solid;
border-color: #000000;
}
#logo {
float: left;
height: 307px;
width: 60%;
color: #fff;
background: #da0000 url(images/bg.gif) 0 0 repeat-x;
}
#featured {
float: right;
width: 40%;
height: 307px;
padding: 0 0px;
background: #da0000 url(images/bg.gif) 60% 0 repeat-x;
}
#featured h2 {
display: none;
text-align: right;
width: 337px;
margin-left: -5px;
font-size: 1.1em;
position: relative;
}
#links {
clear: both;
margin: 0 0;
min-height: 130px;
background: #c21c08 url(images/links.gif) 0 0 no-repeat;
font-size: 1pt;
}
* html #links {height: 130px;} /*sets a height for IE6, triggers haslayout*/
#links ul {
display: inline; /*pretty much only mentioned for IE to prevent stairstepping*/
}
#links a {
float: left;
margin: 0 0 0 0;
min-height: 130px;
color: #fff;
text-align: center;
font-size: 1.4em;
position: relative;
}
* html #links a {height: 130px;}
/*the below code is for those without images, to give visual feedback that they are indeed links*/
#links a:hover, #links a:focus {
text-decoration: none;
color: #ff0; /*yellow*/
outline: 0; /*this is acceptable because we are changing the image on :focus*/
}
#links a span {
position: absolute;
width: 100%; /*of parent, the anchor, whose widths we'll set below*/
height: 100%;
left: 0;
top: 0;
background: url(images/links.gif) 0 0 no-repeat;
}
#print {
width: 115px;
}
#print:focus span, #print:hover span {
background-position: 0 -130px; /*first number is horizontal, second is vertical*/
}
#portraits {
width: 102px;
}
#links #portraits span { /*because I said "#links a span, I need #links to override here*/
background-position: -115px 0;
}
#links #portraits:focus span, #links #portraits:hover span {
background-position: -115px -130px;
}
#web {
width: 102px;
}
#links #web span {
background-position: -217px 0px;
}
#links #web:focus span, #links #web:hover span {
background-position: -217px -130px;
}
#ads {
width: 103px;
}
#links #ads span {
background-position: -319px 0px;
}
#links #ads:focus span, #links #ads:hover span {
background-position: -319px -130px;
}
#all {
width: 96px;
}
#links #all span {
background-position: -422px 0px;
}
#links #all:focus span, #links #all:hover span {
background-position: -422px -130px;
}
#resume {
width: 103px;
}
#links #resume span {
background-position: -518px 0px;
}
#links #resume:focus span, #links #resume:hover span {
background-position: -518px -130px;
}
#me {
width: 110px;
}
#links #me span {
background-position: -621px 0px;
}
#links #me:focus span, #links #me:hover span {
background-position: -621px -130px;
}
#contact {
width: 114px;
}
#links #contact span {
background-position: -731px 0px;
}
#links #contact:focus span, #links #contact:hover span {
background-position: -731px -130px;
}
#learn {
width: 135px;
}
#links #learn span {
background-position: -845px 0px;
}
#links #learn:focus span, #links #learn:hover span {
background-position: -845px -130px;
}
#content {
background: #f6ddad;
height: 66px;
clear: both;
}
#footer {
background: #f6ddad;
height: 66px;
}