tags:

views:

330

answers:

4

What i want to do is have a bold title on the left with a normal size and font text link on the right. The problem can never get only the link beside it. I always get other text or have the link below instead of beside.

test

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="my.css">
</head>
<body>
<div class="main">
<div class="swtitle">
<h1 class="swTitle">Title</h1> <a class="downloadXYZ" href="download.zip">Download</a>
text i dont want. I cant figure out what to write here.
</div>
</div>

</body>
</html>
A: 

Initial thought without CSS would be the following, at least to get your started:

<html>
<head>
    <title></title>
    <link rel="stylesheet" type="text/css" href="my.css">
</head>
<body>
    <div>
        <div style="float: left;">
            <h1>
                Title</h1>
        </div>
        <div style="float: right;">
            <a class="downloadXYZ" href="download.zip">Download</a>text i dont want. I cant
            figure out what to write here.
        </div>
    </div>
</body>
</html>
Jason Heine
+1  A: 

Hi,

I am not a CSS guru but you could try the following (note the "display:inline") on the header tag.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
<html>
    <head>
     <title></title>
     <link rel="stylesheet" type="text/css" href="my.css">
    </head>
    <body>
     <div class="main">
      <div class="swtitle">
       <h1 class="swTitle" style="display:inline;">Title</h1> 
       <a class="downloadXYZ" href="download.zip">Download</a>text i dont want. I cant figure out what to write here.
      </div>
     </div>
    </body>
</html>

Hope this helps!

Rohland
+2  A: 

You should be using the style="display:inline" this will help you get your text you have to wrap around what you are doing, such as images.

<h1 class="swTitle" style="display:inline;">Title</h1>

You can also use the float if you like too, but inline is much better.

+1  A: 

use the style: display:inline

Thanks