|
|
|
|
![]() ![]() |
Dec 26 2005, 02:23 AM
Post
#1
|
|
|
Advanced Member Group: Members Posts: 111 Joined: 26-August 05 Member No.: 8,098 |
Okay, I just jumped onto the CSS bandwagon. Almost immediately I saw the powerful potential that CSS has to design a site much more cleanly. I was an old fashioned tables sort of guy, and I have to say that the layering feature using the div tags is brilliant. It allows for so much more, and so much easier. I designed a little "test" page, so to speak, so that I could fool around with layerings and various tags. The thing is, the page displays "bad". There is a horizontal scroll bar and for the life of me I can't figure out why. I'd host the site if I could, but my account is curiously suspended (another issue in itself). Below is the .css file and the .html file.
mystyles.css CODE body {font-family: Verdana, sans-serif; color: black; font-size: 90%; background-color:white } p {font-family: Verdana, sans-serif; color: black; font-size: 90%; } h1 {font-family: Verdana, sans-serif; color: black; font-size: 150%; text-decoration: underline; } span {position: relative; top: .1%; left:2%; } .innerheader {position: relative; top: .1%; left: 50% } .mainbox {border: 1px coral dashed; position: absolute; left: 15%; top: 10%; height: 80%; width: 70%; padding: 0%; background-color: ffffff; } .leftmenu {border: 0px navy solid; position: absolute; left: 1%; top: 12.5%; height: 75%; width: 15%; padding: 0%; background-color: coral; } test.html CODE <html> <head> <link rel="stylesheet" type="text/css" href="mystyles.css"> <title> Testpage! </title> </head> <body> <div class="mainbox"> <span class="innerheader"> <h1>some words</h1> </span> <span> some more words </span> </div> <div class="leftmenu"> <span>Textbox</span> </div> </body> </html> Save these and load it up and see for yourself. If anyone is able to direct me in getting rid of that ugly scrollbar, which I can't see the reason for being there, I'd appreciate it. If there are any other tips I'd also take them. Thanks in advance! This post has been edited by miCRoSCoPiC^eaRthLinG: Dec 26 2005, 03:24 AM |
|
|
|
Dec 26 2005, 02:35 AM
Post
#2
|
|
|
SM- the Man -The Myth - The Legend Himself Group: Members Posts: 453 Joined: 4-September 05 From: Drinking da rootbeers Member No.: 8,313 myCENTs:55.62 |
i do not see any scroll bars i tried ie and ff and its displays like it should.
|
|
|
|
Dec 26 2005, 04:33 AM
Post
#3
|
|
|
Advanced Member Group: Members Posts: 111 Joined: 26-August 05 Member No.: 8,098 |
Uhmm, weird. Out of curiousity, is there a bottom dashed line on the "some more words" box? Thats also missing for me, not sure if it should be. I'm still getting the scroll bar, too. I'll download Opera and test with that, I guess. In the mean time, anyone else getting a scroll bar? :S This bugs me. -.-
|
|
|
|
Dec 28 2005, 04:54 PM
Post
#4
|
|
|
Newbie [ Level 2 ] Group: Members Posts: 27 Joined: 28-December 05 Member No.: 10,338 |
lol i don't get it...is that the entire code?? i'm confuzzledddd >< i think i'm too new for this hahahahha maybe i'll figure it out later
but go to http://lissaexplains.com/css.shtml and she'll give you a full tutorial on how to make css style sheets =] |
|
|
|
Dec 29 2005, 06:53 AM
Post
#5
|
|
|
Advanced Member Group: Members Posts: 128 Joined: 27-June 05 From: Belington, WV Member No.: 6,653 |
Before I go spewing out suggestions and poking my nose into this matter any further, may I ask your screen resolution and browser?
|
|
|
|
Dec 29 2005, 08:32 AM
Post
#6
|
|
|
Advanced Member Group: Members Posts: 128 Joined: 27-June 05 From: Belington, WV Member No.: 6,653 |
I couldn't help it, I had to mess with it
Okay, I'm not quite sure how this will help you... but that horizontal scrollbar was bugging the hell out of me and I just had to do something about it Lol. First of all, here is the final code revision for the css: CODE body {font-family: Verdana, sans-serif; color: #000000; font-size: 90%; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding: 0%;} p {font-family: Verdana, sans-serif; color: #000000; font-size: 90%;} h1 {font-family: Verdana, sans-serif; color: #000000; font-size: 150%; text-decoration: underline;} span {position: relative; top: .1%; left: 2%;} .innerheader {position: relative; top: .1%; left: 50%; width: 50%;} .mainbox {border: 1px coral dashed; position: absolute; left: 15%; top: 10%; height: 80%; width: 70%; padding: 0%; background-color: white;} .leftmenu {border: 0px navy solid; position: absolute; left: 1%; top: 12.5%; height: 75%; width: 15%; padding: 0%; background-color: coral;} And the HTML: CODE <html> <head> <link rel="stylesheet" type="text/css" href="mystyle.css"> <title>Testpage!</title> </head> <body> <div class="mainbox"> <div class="innerheader"> <h1>some words</h1></div> <span> some more words </span> </div> <div class="leftmenu"> <span>Textbox</span> </div> </body> </html> Sorry I made it so big... I have to have things spaced out since I have horrible eyes. If you see any colors or borders that weren't in your original code, it was so I could distinguish the layers and pinpoint the troublemaker. In this case, I found 2. The "innerheader" and "h1" tags seemed to be was what causing the problems, although I don't know exactly why. If I set the positioning of the innerheader span to absolute, the scrollbar went away, but your "some more words" text got realigned. And the H1... that was just weird. The H1 seemed to have taken on the width properties of your mainbox div, and since it was positioned to 50%, it overlapped half of the box, leaving the other 50% hanging on the left side. THAT was what caused the horizontal scrollbar, I just don't know why. All I can tell you is that I hate relative positioning, and always use absolute (but that's because I have the patience to adjust the coordinates pixel by pixel until I get it right) and that I changed the "some words" text to be contained in a DIV instead of a span. Don't know what it did exactly, but it looks the same as your original page, but without the scrollbar. Good luck figuring out the exact cause of this little mishap, because my brain is way too fried to research it any longer Lol |
|
|
|
Dec 29 2005, 08:35 AM
Post
#7
|
|
|
Advanced Member Group: Members Posts: 128 Joined: 27-June 05 From: Belington, WV Member No.: 6,653 |
Whoops, there should be a closing div tag after the closer for the mainbox layer (so that's 2 </div>'s before <div class="leftmenu">
I'm tired :/ |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 23rd November 2008 - 06:48 PM |