1

I have a problem with IE7.

I'm trying to put 2 buttons in the same line.. but its not working only for IE7 in all other browsers it works as it should( didn't check IE6, will no check). Here is a picture so you know what I mean

alt text

This black border you see is just something I put so I can see how long/tall is my div. Which css style should buttons have in order to be in the same line. Thank you

UPDATE-> HERE IS SOME HTML :

<div style="border:1px solid; width:300px; height:30px; float:left; padding:0;margin:0;text-align:left;">
                    <a class="button niceButton"> 
                        <div id="first" class="action_button">
                            EDIT CATEGORY
                        </div>  
                    </a>
                    <a class="button niceButton"> 
                        <div id="action_delete" class="action_button1">
                            DELETE RECORDS
                        </div>  
                    </a>
                    </div>
Glorfindel
  • 21,988
  • 13
  • 81
  • 109
ant
  • 22,634
  • 36
  • 132
  • 182
  • See a full explanation at: http://stackoverflow.com/questions/1820007/ie7-float-right-problems/1820018#1820018 – mauris Dec 08 '09 at 14:47
  • @thephpdeveloper, tried that also not working with clear both – ant Dec 08 '09 at 15:02

2 Answers2

1

The left one should have float: left; and the right one should have float: right; and it's recommended to place a clear: both; on the element after the div with the buttons.

Example:

<div class="buttons">
    <button class="left">left button</button>
    <button class="right">right button</button>
</div>

with

.buttons {
    width: 300px;
}
.left {
    float: left;
}
.right {
    float: right;
}
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Still not happening I used your style for buttons. I updated the question – ant Dec 08 '09 at 15:00
  • Your code is wrong. You should float the buttons, not the div. – BalusC Dec 08 '09 at 15:27
  • Yes I figured that out, its not actually my code I'm just fixing it , I got rid of div elements used just a, I'll accept your answer – ant Dec 08 '09 at 15:38
0

Have you tried display: inline; on the buttons?

Edit:

also shouldnt the be inside the div around the text like so:

<div id="first" class="action_button">
<a class="button niceButton">EDIT CATEGORY</a>
</div>
WackCSS
  • 33
  • 1
  • 6