Click to See Complete Forum and Search --> : New To CSS


GunnerMan
02-20-2008, 12:57 PM
Hello,
I have been working on a website that a friend asked me to do. We want it to be simple and I started with a framed page, take a look santafestyleart.com So you see the top ad left frames are there well he wanted a bottom and right column to intersect the frames. So I made CSS boxes(using the div tags) to put them on. The problem is it does not go to the edge of the screen like I want it creates a scroll bar. What I want ultimatley is to make my 2 css boxes act like frames IE no scroll bars, flush against the edge and scale to the screen size for different user resolutions. That Way the background image only appears on the inside of my "framed" area and not on the outside or with scroll bars no matter what resolution.

Then I will add a CSS body box in the center for content and figure out how to link my frames/other css boxes to my center content box. I would even do away with frames if that is the best way? What I am aiming for is a square framed screen with variable content in the center.


Thanks for the help!
Gunner

TJ111
02-20-2008, 01:55 PM
There is no need to use frames for this (or really anything in todays world, with the exception of iframes, but for more advanced reasons). I'd recommend building it with <div> tag's instead, using CSS you can have them act as whatever you want.

There are plenty of examples/tutorials floating around the web, a quick google search turned up this one (http://www.sebastiansulinski.co.uk/web_design_tutorials/css/three_column_layout.php). Try using divs and CSS to get the similar layout, then when you run into trouble post it up and we will help you out.

GunnerMan
02-20-2008, 09:45 PM
Ok im pulling my hair out over this. I had my website made with all CSS design and had it looking decent so I uploaded it to test on a few dif computers. Well what I found is different screen sizes totally screw up the layout. Everything gets smashed together, spread appart, repositioned etc etc. I have spent almost all night here trying to figure out how to get my CSS to resize depending on screen size.

I found what I probably need is a "liquid" layout. Well I have all of my sizes set in % and it still does not resize properly. What am I missing here? The website again is santafestyleart.com and as you see looks normal in 1280x1024 resolution but put the res down and everything goes fubar.


Thanks in advance,
Hairless Gunnerman

WebJoel
02-20-2008, 10:00 PM
That is actually not a difficult layout to create, but the "position:fixed" has to go. It's about as helpful as "position:absolute;" when used wantonly. :o

For a 'fluid design', you don't want a main element (such as content DIV) to be 'fixed' unless it is attached to something else that moves...
The only time I even need "fixed' is maybe to have a navigation bar on the left-side of the screen remain 'fixed' at it's location when the user vertically-scrolls the page, and even for that, a special 'fix' is required for IE..

A percentage-width layout is great, and you'd have to also use margins & padding to prevent things from bumping into each other, and 'floats' to make this 'push away' other content when the browser window is re-sized.

I'l see if I can write-up something similar to this:...

GunnerMan
02-20-2008, 10:40 PM
Thankyou, what positions should I use im having a hard time figuring out how the others work. I could never have imagined such a simple looking site could cost me hours and hours of wasted time fiddling with it. My motivation for this is flowing away like a dam just broke...

WebJoel
02-21-2008, 11:25 AM
-Sorry, -I got distracted last night and 'surfed away' until bedtime..

Here is a quick-view version. There are *several methods* of creating this layout, this is just one.
It re-sizes nicely down to 800-width and a bit less (then begins to 'overlap'), and up to 1024-width and wider. Validates, looks the same for IE and Fx. Needs your 'footer' information. <!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=iso-8859-1" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<title></title>

<style type="text/css">
* {border:0; padding:0; margin:0;}/* Set everything to "zero" */

html, body {min-height:100%; /*for compliant browsers*/ height:100%;
font:x-small Arial, Verdana, sans-serif;voice-family: "\"}\"";voice-family:inherit;font-size:small;/*for IE 5.5 */
font-size:100%; line-height:1.125em;}

#wrapper p {color:black; background-color:transparent;}
/*non-content: e.g., -navigation lists, etc. Slightly smaller than content text {font-size:0.75em;} */

ul li {float: left; /* cure IE5.x "whitespace in lists" problem */width: 100%;}
ul li a {height: 1%; /* make links honour display: block; properly */}

#wrapper {min-height:100%; overflow:hidden;} /* 100% height for compliants, enwraps content*/
* html #wrapper {height:100%;}/* and feed IE what it needs */

html, body, p, th, td, li, dd, dt { font:0.875em Arial, Helvetica, verdana sans-serif;}
h1, h2, h3, h4, h5, h6 {font-family: Arial, Helvetica, 'times new roman', sans-serif;}

h1 {font-size: 2.0em;}
h2 {font-size: 1.5em;}
h3 {font-size: 1.2em;}
h4 {font-size: 1.0em;}
h5 {font-size: 0.9em;}
h6 {font-size: 0.8em;}/* Defined default Header sizes*/

a:link, a:visited, a:focus, a:hover, a:active {background-color:none;}/*s.508 Accessibility*/

a:link {color: #00f;}
a:visited {color: #009;}
a:focus, a:hover {color: #06f;}/* a:focus for non-mouse pointers: e.g. "hotkeys", etc. s.508*/
a:active {color: #0cf;}

.navs {width:75px; margin-top:30px;}
.navs li {list-style-type:none; margin:10px 0 20px; padding-left:25px;}
.navs li a:link {font-size:2.1em; color:white; position:relative; top:-3px; text-decoration:none;}
.navs li a:visited, .navs li a:focus {color:black; font-size:2.0em; text-decoration:none;}
.navs li a:hover {color:black; letter-spacing:0.5em; border-bottom:2px solid white;}
.navs li a:active {color:gold}
</style>

</head>
<body style="background-color:#09f;">
<div id="wrapper" style="position:relative;">

<div style="width:auto; height:50px; background-color:#900; padding:0 30px 0 30px;">
<h1 title="Santa Fe Style Art" style="position:relative; z-index:49; width:100%; white-space:nowrap; font-size:3.8em; text-align:center; padding:15px 0 0 0; color:yellow;">Santa Fe Style Art</h1>
<h1 title="Santa Fe Style Art" style="position:absolute; top:2px; left:-3px; z-index:50; width:100%; white-space:nowrap; font-size:3.8em; text-align:center; padding:15px 0 0 0;">Santa Fe Style Art</h1>
</div>

<!-- next: CONTENT/CENTER column with image -->
<div style="position:relative; z-index:10; width:auto; height:430px; border-left:150px solid #900; border-right:150px solid #09f; background-image url(http://www.santafestyleart.com/Images/wood34.jpg); (http://www.santafestyleart.com/Images/wood34.jpg%29;) overflow-y:scroll;">

<p style="text-align:center;"><img alt="this is image ONE" src="http://www.santafestyleart.com/Images/colordpenplanssse.jpg" style="background-color:silver; width:400px; height:auto; margin:35px 0 35px 0; border:3px solid blue; " /></p>

<p style="text-align:center;"><img alt="this is image TWO" src="http://www.santafestyleart.com/Images/colordpenplanssse.jpg" style="background-color:silver; width:400px; height:auto; margin:35px 0 35px 0; border:3px solid blue; " /></p>

<p style="text-align:center;"><img alt="this is imag THREE" src="http://www.santafestyleart.com/Images/colordpenplanssse.jpg" style="background-color:silver; width:400px; height:auto; margin:35px 0 35px 0; border:3px solid blue; " /></p>

</div><!-- end CENTER -->

<div style="position:absolute; left:0; top:50px; z-index:501; height:auto; width:1-0px; background-color:transparent; padding:25px 20px 25px 20px;">
<h1 style="text-align:center;">left</h1>
<ul class="navs">
<li><a title="One" href="#">One</a></li>
<li><a title="Two" href="#">Two</a></li>
<li><a title="Three" href="#">Three</a></li>
<li><a title="Four" href="#">Four</a></li>
<li><a title="Five" href="#">Five</a></li>
</ul>
</div>

<div style="position:absolute; right:0; top:50px; z-index:501; height:auto; width:100px; background-color:transparent; padding:25px 20px 25px 20px;">
<h1 style="text-align:center;">right</h1>
<ul class="navs">
<li><a title="One" href="#">One</a></li>
<li><a title="Two" href="#">Two</a></li>
<li><a title="Three" href="#">Three</a></li>
<li><a title="Four" href="#">Four</a></li>
<li><a title="Five" href="#">Five</a></li>
</ul>
</div>

</div>
</body>
</html> The only 'important stuff' here is BOLD. Everything else is just page set-up for x-browser, etc.

Notice the header text... that IS text. By positioning two identical text-tags (with different colors) and 'positioning' one slightly askew, we get a nice 3-D effect. I thought it looked nice. ...My motivation for this is flowing away like a dam just broke... Don't lose hope! Once you 'get it', you will find yourself unable to get to sleep at night, anxious for the next build! Eager to learn some new 'trick' and use it on a site. :)

Note that this referances two of your images via absolute-path to your current site. You wopuld probably want to use the images 'relative' to the html-document (place this document in a folder with the images and referance that way).

GunnerMan
02-21-2008, 12:59 PM
Thankyou so much for that. Right now most of it looks like jibberish to me but I will play with it tonight and figure out what does what. It seems your using a whole different code structure then what I was learning...

WebJoel
02-21-2008, 01:55 PM
If you want some good excercise and enjoy experimentation, visit:

strangebanana(dot)com

and get some programmatically-generated one-of-a-kind DHTML templates, and experiement with them. They are FREE, and no template is ever exactly the same.
Bend 'em, build 'em, bust 'em. -Can't fix it? Delete it and get another, or a dozen.
Only one of every 10 pr 20 'built on-the-fly' templates really looks even moderately 'nice', but get a few 'nice ones' and find out what does what, chat can be changed, etc. Most of these validate (to some degree). You will quickly discover by example and trial-&-error what works, what busts, etc.

I used to play around alot here between classes... now I just build my own.