Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

UGH!!! its those DIV's again... [RESOLVED]

Chief

Member

im not sure what to do... i have my div's but on seperate lines... ive tried a crap load of stuff but im not sure what to do... and when i do get them up on seperate lines, they are way far apart... like if i float one to left and one to right... i dont want them liek taht... i awnt the sitting in the middle. one has a width of 600px and the otehr has a width of 200px... i need them to site together to make up the 800px in the middle.... any ideas?

[ISSUE RESOLVED]
 
Use percentages instead of pixel values, else it will display something that is too large for the window and stack them instead of place them side by side.
 

Chief

Member

i have no knowledge of what percentages to use... you wanna clue me in as tow aht 800px and 200px would be in %?
 
it sounds like you need a container div around them. but it's hard to say without a example of your css and possibly a screenshot.

Chief":2a6ggbtf said:
i have no knowledge of what percentages to use... you wanna clue me in as tow aht 800px and 200px would be in %?

The entire point of percentages is that they aren't equivalent to some fixed pixel width. Percent widths are fluid and depend on the width of the broswer.
 

Chief

Member

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>MidWest Shool of Diving • Home</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body background="bg3.jpg" style="background-position:center; padding:0;" topmargin="0" alink="9c9c9c" vlink="9c9c9c" link="9c9c9c">
<center>
<div style="height:150px;width:800px;padding:0;text-align:right; background-image:url(banner2.png)">
<font color="FFFFFF">...</font>
<font color="9c9c9c" size="-1">
<b>
<SCRIPT LANGUAGE="JavaScript">

</SCRIPT>
</b>
</font>
</div>
<div style="height:25px;width:806px;text-align:center;padding:0; background-image:url(cellpic1.jpg)">
<font face="Comic Sans MS, Arial, Helvetica" size="-1">
<b>
• Home Page  
• Page  
• Page  
• Page
</b>
</font>
</div>
<div style="height:450px; width:600px; text-align:left; padding:0;overflow:auto;">
<font face="Comic Sans MS, Arial, Helvetica" color="#000000" size="-1">
bla bla bla bla bla
</font>
</div>
<div style="height:450px;width:200px;text-align:left;padding:0;overflow:auto;">
<font face="Comic Sans MS, Arial, Helvetica" color="#000000" size="-1">
bla bla bla bla bla
</font>
</div>
</div>
</center>
<center>
<div style="height:31px;width:804px;">
<marquee>
<img src="padi.png" border="0">  
<img src="dan.png" border="0">  
</marquee>
</div>
<div style="height:25px;width:806px;text-align:center;padding:0; background-image:url(cellpic1.jpg);">
<font color="9c9c9c" face="Comic Sans MS, Arial, Helvetica" size="-1">
<b>&copyCopyright 2008 MidWest School of Diving</b>
</font>
</div>
</center>
</body>
</html>

and here is the scrn shot:
http://img89.imageshack.us/img89/1187/largescrnum7.png[/img]

right now, i have a center tag around them and so both divs are centered but the lower smaller dive should be up on the right next to the larger div which should be to the left.
 
You should really use a seperate CSS file so all this is clear and easier for you to edit.
800px and 200px would be 80% and 20%, percentages can be changed to anything mathmatical so experiment with 80% 20%, 70% 30%, anything aslong as it adds up to 100.
 

Chief

Member

im actually new to CSS so any help or put me in the direction of help would be very helpful... seperate CSS file? hmmm... help?

EDIT:

Can someone jsut answer my original question and lay the code out for me... cuz im frustrated and at the end of my patience... im sorry but ive been stuck now for 48hrs...
 
Xilef":1lp9b28m said:
You should really use a seperate CSS file so all this is clear and easier for you to edit.
800px and 200px would be 80% and 20%, percentages can be changed to anything mathmatical so experiment with 80% 20%, 70% 30%, anything aslong as it adds up to 100.

don't confuse him.

you're using a fixed width layout, so there's no need to deal with percentages.

you're hitting some MAJOR web design no-nos with this, though.

never use marquee seriously
never use comic sans seriously
use a style sheet instead of using the style tag for individual elements

do a google search on how to use a style sheet, it will save you a LOT OF TROUBLE trust me
 
put a container div around them

i.e

<div class="container" style="width: 800px; padding: 0px; margin-left: 0 auto; margin-right: 0 auto;">
<div class="left" style="float: left; width: 200px;"><div class="right" style="float: right; width: 600px;">
</div>

the margin-left and margin-right set to auto is the important thing.  But you really should use a separate stylesheet, i'm just too lazy to show you this using one
 

Chief

Member

omg... thnkyou very much... but this teaches me a lesson... get better with CSS and learn to use seperate stylesheets... but this was a good experience for me and i can move on and finsih this freaking thing... GOD! =[]

edit:

any idea why:

<font face="Comic Sans MS, Arial, Helvetica" color="#000000" size="-1">

wont work in FF?
 
the font tag is deprecated.  It's ancient and is outdated entirely w/CSS.

Just use <span style="blah blah blah"> or better yet <span class="blah">
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top