My website looks strange on a smaller resolution

Vezel

Member
Nov 20, 2012
92
4
Okey so this is what happens:
This is how it looks like on my screen that i code on: (if you think it's ugly it's becouse i started to code 2 days ago and this is my first website :p)
This is how it looks on a smaller screen:

Code:
HTML:
<!doctype html>
 
<html>
<head>
<title>Vezel - Home</title>
    <link rel="stylesheet" type="text/css" href="configs/ccsconfig.css"/>
    <style type="text/css">   
 
    </style>
</head>
<body>
<div class="boxed">
<a href="index.html" id="active">Home</a>
<a href="about.html" id="About">About</a>
<a href="info.html" id="Info">Info</a>
<a href="contact.html" id="Contact">Contact Me</a>
</div>
 
<div class="nav">
<a href="news.html" id="active">News</a>
 
 
 
</div>
<div class="infobox">
<div class="text">
<header>
<hgroup><h1>Vezel's Website</h1></hgroup>
<header>
 
 
<p>This site is made by Vezel and this is my first Website that i've ever made,
since it's my first it isnt so good and im just doing it to test out html.</p>
 
</div>
</div>
<div id="menu">
<div id="login">
<p><strong>Login here:<strong></p>
<form>
<b>Username:</b> <input type="input" name="Button"/>
    <br/>
<b>Password:</b> <input type="password" name="pass"/ id="pass"/>
    <br/>
<div id="submit">
    <input type="submit" name="submit" value="Submit">
</form>
 
</div>
</div>
</div>
 
</div>
</body>
</html>

CSS:
Code:
        b {color:white}
        #pass {position:absolute;
                left: 77px;}
        form {border 1px solid red}
        #menu {position:absolute;
                top: 500px;}
        #submit {position:absolute;
                left: 0px;
                top: 95px;}
        #login {position:absolute;
                background-color:540303;
                top: -100px;
                left: 5px;
                width: 250px;
                height: 120px;}
        body {background-image:url(bilder/bg.jpg);
            background-size:100%;}
        .boxed {border: 1px solid black;
                background-color:#A21111;
                width: 250px;
                height: 980px;}
        a:link {color:white;
                text-decoration:none;
                font-size:25px;}
        a:hover {color:black;
                text-decoration:underline;}
        a:visited {color:white}
        #Home{position:absolute;
            top:10px;
            left:15px;}
        a#active { color: black;
                position:absolute;
                top:10px;
                left:15px;}
        a#About {position:absolute;
                top:50px;
                left:15px;}
        a#Info {position:absolute;
                top:90px;
                left:15px;}
        a#Contact {position:absolute;
                top:130px;
                left:15px;}
        .nav {position:absolute;
            top:15px;
            left:400px;
            width:1300px;
            height:50px;
            background-color:#A21111;}
        .infobox {position:absolute;
                top:100px;
                left:444px;
                width:1200px;
                height:750px;
                background-color:#A21111;}
        .text {position:absolute;
              top:1px;
              left:1px;
              border: 2px solid #870505;
              height:300px;
              width:400px;}
        h1{padding: 2px;
          font: 20px Palatino Linotype;
          color: #white;}
        p {color:white;
          margin-top:10px;
          text-indent:25px;}

As is said, it's my first website and im just trying to get better on coding so pleaase no hate on the code but you can give me ideas on what i should change/add, and ofc i would be nice if you could answere my question and show me how to do next time i code :)
 

TesoMayn

Boredom, it vexes me.
Oct 30, 2011
1,482
1,482
Responsive changes the CSS depending on the resolution of the screen.

As you only asked how to fix this problem, you can do what Holmes said, or you can Google how to do responsive web design.
 

Vezel

Member
Nov 20, 2012
92
4
Responsive changes the CSS depending on the resolution of the screen.

As you only asked how to fix this problem, you can do what Holmes said, or you can Google how to do responsive web design.
Okey, but i said that i was a beginner with this so can you explain how to do? :)
 

Forget

Member
Apr 3, 2012
120
14
You should always do a simple content box around all your work so this doesn't happen.

Eg..
.content_box{margin:auto;width:800px;}
<div class="content_box">
....code.....
</div>


This will stop miss placing of boxs and different browsers read your code in different ways since they have default settings you should also use body, in the css....

body{padding:0;margin:0;}

Also declare text size and font etc in this:)
 

Users who are viewing this thread

Top