14

I am trying to layout the content for a popup dialog box, but not having much luck

I've tried using both spans and inline divs, but neither of them seem to respect the width or min-width CSS

any ideas?

Here's the Html

<div id="MessageBox" class="ui-dialog-content ui-widget-content" style="width: auto; min-height: 40.8333px; height: auto;" scrolltop="0" scrollleft="0">

<div class="popupKey">Bank Reference</div>
<div class="popupValue"></div>
<br>
<div class="popupKey">Amount</div>
<div class="popupValue">650.00</div>
<br>
<div class="popupKey">Currency</div>
<div class="popupValue">GBP</div>
<br>
<div class="popupKey">PaymentDate</div>
<div class="popupValue">02/06/2011</div>
<br>
<div class="popupKey">Remitter</div>
<div class="popupValue"></div>
<br>
<div class="popupKey">Senders Reference</div>
<div class="popupValue"></div>
<br>
</div>

and the CSS

.popupKey
{
    display : inline;
    min-width: 150px;
}

.popupValue
{
    display : inline;
    min-width: 150px;
}

I would like all the items in the popupValue column to be aligned

there's a JSFiddle here:

http://jsfiddle.net/NtK4Y/

3 Answers 3

25

Inline content can't have a width defined. Try using display: inline-block or using display: block; float: left;

I've updated your jsfiddle; have a look at http://jsfiddle.net/NtK4Y/1/

Sign up to request clarification or add additional context in comments.

1 Comment

if you add float: left; you automatically declare element as block, so in that case I believe display: block is unnecessary
6

Use inline-block instead of inline.

You can see updated jsfiddle http://jsfiddle.net/NtK4Y/2/

Comments

1

A float:left also might help your problem, they will be placed next to each other.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.