Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-11-2013, 10:23 AM   PM User | #1
julz103
New to the CF scene

 
Join Date: Feb 2012
Location: Australia
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
julz103 is an unknown quantity at this point
wtf am i doing wrong!

This is such a lame thing to post about, but its busting my balls - iv been on w3schools for ages, i can see kinda whats wrong, but when i fix it it does nothing!!!!

i cant get div tags to sit next to each other they just keep positioning themselves underneath each other


HTML:
PHP Code:
<!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=utf-8" />
<
title>Trade Quote Sign-in</title>

<
link href="stylesheets/style.css" rel="stylesheet" type="text/css" />
</
head>

<
body>
<
div class="container">

    <
div class="logo_container" >

<
h1Tradequote.com </h1>
</
div>

        <
div class="blurb">

<
pTradequote.com allows users to post details about their home design or repair work and have tradesman and Design or repair companys view quotes made to the client by other companys.</p>

<
p>Need some repair work done around the house? or want to re-do your kitchenLet us help you find someone to do the work at a reasonable price. - <a href="/signup.php" title="">Sign-up</a></p>
</
div>


            <
div class="menu_container">

            <
a href="/index.php" title="Go to the font page">Home</a>

            <
a href="/about.php" title="">About</a>
|
            <
a href="/contact.php" title="">Contact</a>
|
            <
a href="/help.php" title="">Help</a>
|
            <
a href="/signup.php" title="">Sign-up</a>
</
div>

                <
div class="client_signin">
<
h2Client Sign-in</h2>
<
p>username:   
  <
input name="username" type="text" size="30" />
</
p>
<
p>password:
  <
input name="password" type="password" size="30" />
</
p>

<
p
  <
input name="Sign-in" type="button" value="Sign-in" />
  <
br />
  
Sign-in to view quotes and manage your jobs</p>
                </
div>

                    <
div class="tradesman_blurb">

<
h3> If you quoted a client on some work recently and they gave you our link or cardclick to sign-in below by entereing your Mobile number or Company email</h3>
</
div>

<
div class="tradesman_signin">
<
h1>Tradesman or Company Sign-in</h1>

<
p>Mobile Number:
  <
br />
  <
input name="Mobile Number" type="text" size="30" />
</
p>
<
p>Company email:
  <
br />
  <
input name="Company Email" type="text" size="30" />
</
p>

<
h1> OR </h1>

<
p>Mobile Number:
  <
br />
  <
input name="username" type="text" size="30" />
</
p>
<
p>Password:<br />
  <
input name="pssword" type="password" size="30" />
  <
br />
  <
input name="Sign-in" type="button" value="Sign-in" />
  <
br />
  
Sign-in to view and manage your quotes</p>
<
table width="210" border="1">
  <
tr>
    <
td>Mobile number and company email are used to verfiy user only - <strong>we wont ever give it away</strong></td>
  </
tr>
</
table><br />
</
div>

<
br />
<
div class="footer">
<
a href="/privacy.php" title="privacy">Privacy Policy</a> | <a href="/contact.php" title="Contact">Contact</a> | Copyright 2013 tradequote.com</div>
</
div>
</
body>
</
html
CSS:
PHP Code:
@charset "utf-8";
/* CSS Document */

.container {
    
    
width:900px;
}

.
blurb {

    
width:300px;
    
float:left;
}

.
logo_container {
    
    
Width225px;

    
}

.
menu_container {
    
    
Width250px;
    
padding-left300px;
    
}

.
client_signin {

    
Width200px;
    
}

.
tradesman_blurb {
    
float:right;
    
Width350px;
    
}

.
tradesman_signin {
    
    
float:right;
    
text-align:center;
    
width450px;
    
}

.
footer {
    
    
width200px;
    
float:left;
    

julz103 is offline   Reply With Quote
Old 02-11-2013, 04:01 PM   PM User | #2
Frankie
Regular Coder

 
Join Date: Sep 2011
Posts: 287
Thanks: 3
Thanked 33 Times in 33 Posts
Frankie is an unknown quantity at this point
Which divs do you want positioned next to each other?
__________________
Frank

How to: Target IE in, Position in, Center in, Create a Fixed ('Sticky') Footer with, and Create a Drop-Down/Fly-Out Menu with CSS: Website Laten Maken Amsterdam.
Frankie is offline   Reply With Quote
Old 02-11-2013, 05:06 PM   PM User | #3
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Hello julz103,
Three simple things you need:

To get elements positioned side by side we use floats. See a float tutorial here.

You also need to follow the box model rule. Make sure the width of your floats doesn't exceed the width of their containing elelment.

And, last, you will probably need to clear your floats so their containing element behaves the way you want.
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Old 02-11-2013, 05:48 PM   PM User | #4
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
I started messing around with it a little but, since I have no idea what your layout is supposed to look like ...

Anyway, have a look at how h1#logo and your menu are side by side. Maybe this will give you some fresh perspective.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Trade Quote - Sign-in</title>
<style type="text/css">
html, body {
	margin: 0;
	background: #fc6;
	font: 100% "Trebuchet MS", Arial, Helvetica, sans-serif;
	color: #000;
}
#container { 
	width: 900px; 
	margin: 50px auto;
	font-size: 1em;
	overflow: auto;
	background: #ccc;
}
h1#logo_container { 
	height: 50px;
	width: 225px; 
  	margin: 0;
	float: left;
	display: block;
	font-size: 1.6em;
	background: #f00 url(path/to/yourImage.jpg);
}
.menu_container {
	line-height: 50px;
	margin: 0 0 0 225px;
	padding: 0 0 0 25px;
}
.blurb {
	width: 300px;
	padding: 0 16px;
	float: left;
}
.client_signin { Width: 200px; }
h3#tradesman_blurb {
	float: right;
	Width: 350px;
}
.tradesman_signin {
	float: right;
	text-align: center;
	width: 450px;
}
.footer {
	width: 200px;
	float: left;
}
</style>
</head>

<body>
<div id="container">
    <h1 id="logo_container"><a href="Tradequote.com">Tradequote.com</a></h1>
    <div class="menu_container"> 
        <a href="/index.php" title="Go to the font page">Home</a> | 
        <a href="/about.php" title="">About</a> | 
        <a href="/contact.php" title="">Contact</a> | 
        <a href="/help.php" title="">Help</a> | 
        <a href="/signup.php" title="">Sign-up</a> 
    <!--end .menu_container--></div>
        <div class="blurb">
            <p> 
            	Tradequote.com allows users to post details about their home design or repair work and have 
                tradesman and Design or repair companys view quotes made to the client by other companys.
            </p>
            <p>
            	Need some repair work done around the house? or want to re-do your kitchen? Let us help you 
                find someone to do the work at a reasonable price. - <a href="/signup.php" title="">Sign-up</a>
            </p>
        <!--end .blurb--></div>
    <div class="client_signin">
        <h2> Client Sign-in</h2>
        <p>username:
        <input name="username" type="text" size="30" />
        </p>
        <p>password:
        <input name="password" type="password" size="30" />
        </p>
        <p>
        <input name="Sign-in" type="button" value="Sign-in" />
        <br />
        Sign-in to view quotes and manage your jobs</p>
    <!--end .client_signin--></div>
        <h3 id="tradesman_blurb"> 
            If you quoted a client on some work recently and they gave you our link or card, 
            click to sign-in below by entereing your Mobile number or Company email
        </h3>
  <div class="tradesman_signin">
    <h1>Tradesman or Company Sign-in</h1>
    <p>Mobile Number: <br />
      <input name="Mobile Number" type="text" size="30" />
    </p>
    <p>Company email: <br />
      <input name="Company Email" type="text" size="30" />
    </p>
    <h1> OR </h1>
    <p>Mobile Number: <br />
      <input name="username" type="text" size="30" />
    </p>
    <p>Password:<br />
      <input name="pssword" type="password" size="30" />
      <br />
      <input name="Sign-in" type="button" value="Sign-in" />
      <br />
      Sign-in to view and manage your quotes</p>
    <table width="210" border="1">
      <tr>
        <td>Mobile number and company email are used to verfiy user only - <strong>we wont ever give it away</strong></td>
      </tr>
    </table>
    <br />
  </div>
  <br />
  <div class="footer"> <a href="/privacy.php" title="privacy">Privacy Policy</a> | <a href="/contact.php" title="Contact">Contact</a> | Copyright 2013 tradequote.com</div>
</div>
</body>
</html>
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Reply

Bookmarks

Tags
div, noob, positioning

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:58 AM.


Advertisement
Log in to turn off these ads.