Jump to content

basic help needed.


seany123

Recommended Posts

CSS code

.left{
height: 50px;    
font-size: 32px;
text-align: left;
margin-left: 100px;         
}

.right{
height: 20px;
width: 50%;
text-align: right;
margin-right: 100px;    
}

 

html code

 

<html>
    <head>
        <title>Welcome to my website</title> 
        <link type="text/css" rel="stylesheet" href="css/style.css" />
    </head>
    <body>
        <div class="left">
       LOGO
        </div>
        <div class="right">
         RIGHT
        </div>
    </body> 
</html>

 

above is the code... basically im having a couple of problems,

 

For some reason when i edit height of .left it changes the text for things in .right (without changing .left)

 

i also want .left to stop around 30% across the screen... allowing for .right

 

 

Link to comment
Share on other sites

What does "it changes the text for things in .right" mean?

 

As for your other problem (having the left on the left, right on the right) you need to look into floats.

 

what it meant was when changing say height of the .left class it would actually change the height of text which was inside my .right class.... however i think i have that fixed.

 

Currently my problem is that when i start to make the browser smaller.. text from the .right class moves below text from the .left class.... rather than just falling off the right side of the screen..

 

 

.topbar{ 
clear: both;
margin-left: auto;
margin-right: auto;   
Width: 100%;
Height: 82px;
position: absolute;
Background: #ffffff ;
Color:#ff0000;
Font-size:18px;
display: block;
background-color: #FF4A12;
}

.left{
float: left;
font-size: 20px;
text-align: left;
margin-left: 100px;      
}

.right{   
margin-top: 5px;   
float: right;
font-size: 12px;
text-align: left;
margin-right: 100px; 
}

Link to comment
Share on other sites

it moves in... as in like moves with the browser getting smaller.

 

 

i have a new problem now -

 

 

#centered {
   
    text-align: left;
    background-image:#000;
    margin: 10px auto 10px auto;
    border: black solid 20px; 
    width: 810px;
    background-image: url('/images/content-bg.jpg');
    background-position: top right;
    
    -moz-border-radius:15px;

   -webkit-border-radius:15px;

    behavior:url(border-radius.htc);

}

 

i have the above code and im using it as a box on my website..

 

then i have

 

this html code:

 

html>
    <head>
        <title>Welcome</title> 
        <link type="text/css" rel="stylesheet" href="css/test.css" /> 
    </head>
    <body background="/images/body-bg.jpg">
    <div id="centered">
    HELLO
    <table width="10%" height="10%">
    <form method="index.php">
        <input type="submit" name="submit" value="submit">
    </form>
    </table>
    </div>
</body>
</html>

 

 

now my problem is that the button reaches down the entire size of the css box and i dont know how to fix it.

Link to comment
Share on other sites

Stick with your original problem. If you have another issue, you should open another thread.

 

As to your original problem, You either have to pick a fixed width or a variable width. If you want a fixed width, with two elements floating beside each other, that don't move when the browser is shrunk, you can do this:

 

<div id="container">
  <div id="col1">Some stuff for column 1</div>
  <div id="col2">Some stuff for column 2</div>
</div>

 

CSS:

#col1, #col2
{
  width:50%;
  float:left;
}
#container
{
  width:900px;
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.