0

I am new I dont know more about code. I want one link on left side of a block and other link on right side. I am using the below command. Both are coming on the correct side but one in the new line. I have given the correct code in css but i think some html code problem. Please let me know the error in below.

       <div class="more">
       <span><a href="http://www.fe.com/discuss">See More</a></span>
       </div>
       <div class="placeadhere">
       <span><a href="http://www.fe.com/posting.php?mode=post&f=16">Place Ad Here</a></span>
       </div>

My CSS is

.more {
font-size:11px;
text-align:right;
margin:5px 0 10px 0;

}

.placeadhere {
font-size:11px;
text-align:left;
margin:5px 0 10px 0;

}

The image is enter image description here

THANKS YOU VERY MUCH MY PROBLEM SOLVE WITH YOUR ANSWERS... LOVE YOU AND SOF..

2
  • I have added css code also. Please check it.. thanks.. Commented Nov 28, 2012 at 11:55
  • @user1820652 You can find the demo in my solution. Hope you understood the concept.
    – Shiridish
    Commented Nov 28, 2012 at 12:07

5 Answers 5

0

I think the problem IS your css. You should paste that too.

<div class="more" style="width:auto; float: left;">
       <span><a href="http://www.fedri.com/discuss">See More</a></span>
</div>
<div class="placeadhere" style="width:auto; float: right;">
       <span><a href="http://www.fedri.com/posting.php?mode=post&f=16">Place Ad Here</a></span>
</div>
1
  • Soo many answers all are working.... very good friends thanks you very very much... love you and SOF.... Commented Nov 28, 2012 at 12:04
0

You can see this in working at http://cssdeck.com/labs/tztgz6hy/0

I added an additional div around your entire HTML fragment it should look like

<div class="main">
    <div class="more">
        <span>
            <a href="http://www.fedri.com/discuss">See More</a>
        </span>
    </div>
    <div class="placeadhere">
        <span>
            <a href="http://www.fedri.com/posting.php?mode=post&f=16">Place Ad Here</a>
        </span>
    </div>
</div>

and CSS

.more {
font-size:11px;
text-align:right;
margin:5px 0 10px 0;
}
.placeadhere {
font-size:11px;
text-align:left;
margin:5px 0 10px 0;
}
.main .more{float:left;}
.main .placeadhere{float:right;}
1
  • Soo many answers all are working.... very good friends thanks you very very much... love you and SOF.... Commented Nov 28, 2012 at 12:04
0

use this customize your div width

<div style="width:somevalue">
        <div class="more">
         <span><a href="http://www.fedri.com/discuss">See More</a></span>
       </div>
       <div class="placeadhere" style="float:right;">
        <span><a href="http://www.fedri.com/posting.php?mode=post&f=16">Place Ad Here</a></span>
       </div>
   </div>
2
  • Soo many answers all are working.... very good friends thanks you very very much... love you and SOF.... Commented Nov 28, 2012 at 12:06
  • @user1820652 Remember you can upvote answers that helped you and also selecting the best answer by ticking it..
    – Shiridish
    Commented Nov 28, 2012 at 12:11
0

Just add float

.more {
font-size:11px;
text-align:right;
margin:5px 0 10px 0; float:right
}

.placeadhere {
font-size:11px;
text-align:left;
margin:5px 0 10px 0; float:left
}​

DEMO

0

Div's are block elements and will occupy the full width. Specify the div as inline so that it takes up only required width. OR you can make your div's positioning to absolute and float them as required.

.more {
 display: inline;
    float: left;
    font-size: 11px;
    margin: 5px 0 10px;
    text-align: right;
}

.placeadhere {
 display: inline;
    float: right;
    font-size: 11px;
    margin: 5px 0 10px;
    text-align: left;
}

See the working fiddle- http://jsfiddle.net/bkgJT/

1
  • cdeez please can you let me know the code.. I dont know more of it. Commented Nov 28, 2012 at 11:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.