开发者

Putting a DIV tag inside another DIV tag

开发者 https://www.devze.com 2023-03-14 12:53 出处:网络
I am pretty new to web design stuff but what I understood from DIV tag is that I it like a logical container for what ever is inside it and those thing will follow its rules..

I am pretty new to web design stuff but what I understood from DIV tag is that I it like a logical container for what ever is inside it and those thing will follow its rules.. so now I have an outer DIV tag defined as <div style="margin-left: 10px;" >and I have put some textbox, buttons, comboboxes inside it...now I also have a HyperLink that I want it to be there BUT I want this one to be at the right hand side , aligned to right , so I defined another DIV like <div align="right"> and put the hyperlink insde this one. they are all still inside that other outer DIV tho. but it is not going to开发者_开发技巧 the right...what is wrong and how can I fix it? I attached the picture, see I want it to be like this picture, at the right hand side of that combobox...

thanks all

Putting a DIV tag inside another DIV tag


As long as you need to align inline element (your link tag) to the right, you can use text-align property of the style, and set it to right:

<div style="text-align:right">
  <a href="">blabla</a>
</div>


there is no align. Do you mean text-align? That will affect inline elements within block level elements.


Try this:

<div style="margin-left: 10px;">
    <p>Reason for Referral</p>
    <input type='text'></input>
    <div style="display:inline"><a href='#'>Not Found?</a></div>
</div>


Maybe its below the combobox becouse the text is too long to fit in the outer div? that would make it go one row lower.


If you have something like:

<div class='group'>
    <p>Reason for Referral</p><br/>
    <input type='text'></input>
    <div class='right'><a href='#'>Not Found?</a></div>
</div>

Then in css:

div.right {
    float: right;
}

You should get something close to the effect you want.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号