• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

HTML code not working properly

dydocan

dydocan
Joined
Jul 2, 2010
Messages
95
Reaction score
0
PHP:
<html>
<body style="background-image:url(main/ddn.png); background-position:middle">
<div style="padding-left: 620px;" />
<div style="padding-top: 100px;" />
<h1 style="color:red">LALALALA!</h1>
<a href="***">
<img src="main/wom.png" border="0">
<div style="padding-left: 620px;" />
<div style="padding-top: 200px;" />
</a>
<a href="****"/>
</div>
</body>
</html>

Well the first padding is working perfect on the text but when i want to pad the image nothing is happening can anybody make the code for me please so the image pads too..

and please don't do it like this

<img src="main/wom.png" border="0" style="padding-top: 200px; style="padding-left:

I need to have them seperate or it won't work need to have them like this

<img src="main/wom.png" border="0">
<div style="padding-left: 620px;" />
<div style="padding-top: 200px;" />

but I know that I didn't write something right but I need to have the padding-left and padding-top seperate.
 
I am not sure exactly what you are trying to accomplish, but if I did interpret you properly, this is what you want:
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
    <title>My Site</title>
    <style type="text/css">
        body {
            background-image: url( 'main/ddn.png' ) middle;
        }
        div.top {
            height: 200px;
        }
        div.left, div.right {
            min-height: 1px;
            float: left;
        }
        div.left {
            width: 620px;
        }
        .clear {
            clear: both;
        }
    </style>
</head>
<body>
    <div class="top"></div>
    <div class="left"></div>
    <div class="right"><h1 style="color: red;">LALALALA!</h1></div>
    <div class="clear"></div>
    
    <div class="top"></div>
    <div class="left"></div>
    <div class="right"><img src="main/wom.png" alt="My Image" /></div>
    <div class="clear"></div>
</body>
</html>
 
well that script isn't working at all I don't understand is that div.left and div top controling both of the pads because I wanted the separate and my background picture isn't even being loaded ...
 
Oops. Change
HTML:
background-image: url( 'main/ddn.png' ) middle;
to
HTML:
background: url( 'main/ddn.png' ) middle;
And they are separate.
 
Look

PHP:
<html>
<head>
<title>****</title>
<head/>
<body style="background-image:url(main/ddn.png); background-position:middle">
 "THIS  <div style="padding-left: 620px;" /> THIS"
 "THIS  <div style="padding-top: 100px;" /> THIS" 
<h1 style="color:red">LALALALA!</h1>
</div>
</body>

<html>
<a href="***">
<img src="main/wom.png" />
<a href="****"/>
</div>
</body>
</html>


They are controling both the <img src="main/wom.png" /> and the
<h1 style="color:red">LALALALA!</h1>

I only want the padding to control the <h1 style="color:red">LALALALA!</h1> do you understand me now? my script is fine I just need you to change something so it only controls the damn text not the image
 
I think I understand you better. But your HTML is a mess that I cannot properly interpret. But I will do my best to assist you anyway.
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
    <title>My Site</title>
    <style type="text/css">
        body {
            background: url( 'main/ddn.png' ) middle;
        }
        h1.padded {
            margin-top: 200px;
            margin-left: 620px;
            position: absolute;
            z-index: 3;
        }
    </style>
</head>
<body>
    <h1 class="padded" style="border: 1px solid blue;">LALALALA!</h1>
    <img style="border: 1px solid red;" src="main/wom.png" alt="My Image" />
</body>
</html>
 
Last edited:
PHP:
<html>
<head>
<title>****</title>
</head>
<body style="background-image:url(main/ddn.png); background-position:middle">
<div style="padding-left:620px;padding-top:100px">
<h1 style="color:red">LALALALA!</h1>
</div>
</body>

<a href="****">
<div style="padding-left:400px;padding-top:170px">
<img src="main/wom.png" />
<a href="****"/>
</div>
</body>
</html>

I fixed it and this is how it needed to be but thanks alot for the attention you atleast responded and tried to help me even if I explained what I wanted bad, thanks alot!
 
PHP:
<html>
<head>
<title>****</title>
</head>
<body style="background-image:url(main/ddn.png); background-position:middle">
<div style="padding-left:620px;padding-top:100px">
<h1 style="color:red">LALALALA!</h1>
</div>
</body>

<a href="****">
<div style="padding-left:400px;padding-top:170px">
<img src="main/wom.png" />
<a href="****"/>
</div>
</body>
</html>
I fixed it and this is how it needed to be but thanks alot for the attention you atleast responded and tried to help me even if I explained what I wanted bad, thanks alot!
I'm glad you managed to solve it! But you still have a few flaws in your HTML. I fixed it for you though.
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
    <title>******</title>
</head>
<body style="background: url( 'main/ddn.png' ) middle;">
    <div style="padding: 100px 0px 0px 620px;">
        <h1 style="color: red;">LALALALA!</h1>
    </div>
    
    <a href="*****">
        <div style="padding: 170px 0px 0px 400px;">
            <img src="main/wom.png" alt="Wom" />
        </div>
    </a>
</body>
</html>
PS. Wrapping <A> elements around block elements (e.g. divs) is not recommended.
 
Back
Top