css-float

Which is better for left-to-right layout: float or display:inline?

给你一囗甜甜゛ 提交于 2019-12-22 16:32:13
问题 I have some icons inside divs and needed to lay them out with a left-to-right structure instead of the default top-to-bottom layout that seems to come with divs. It's probably not news to most people who know CSS but I figured out (with a little help) that I could cause the divs to layout left-to-right using either: float: left/right or display:inline. My question is - is one preferable over the other ? <div id="icons"> <div id="divtxt" class="divicon"> <img src="/icons/text.png" id="icontxt"

Which is better for left-to-right layout: float or display:inline?

僤鯓⒐⒋嵵緔 提交于 2019-12-22 16:32:04
问题 I have some icons inside divs and needed to lay them out with a left-to-right structure instead of the default top-to-bottom layout that seems to come with divs. It's probably not news to most people who know CSS but I figured out (with a little help) that I could cause the divs to layout left-to-right using either: float: left/right or display:inline. My question is - is one preferable over the other ? <div id="icons"> <div id="divtxt" class="divicon"> <img src="/icons/text.png" id="icontxt"

How to making full height on every screen for section or div inside body?

独自空忆成欢 提交于 2019-12-22 11:09:25
问题 Hi all am created a html layout having two sides left and right left one having navigation menu and right having contents i need both has full-height has to come to bottom of the screen even there is very low contents. now it looks like here my fiddle demo moreover i tried full height for body and html to body, html{ height:100%; } 回答1: (relevant) HTML: <div class="wrapper"> <div class="left"> <!-- stuff --> </div> <div class="spacer"></div> <div class="right"> <!-- stuff --> </div> </div>

Disable text wrapping around floating images

二次信任 提交于 2019-12-22 10:59:51
问题 I have a page which looks like this: <div> <p> This text appears above the image</p> <!-- I know the <div><p> construction is superfluous. I was just trying things out --> </div> <div style="display: block; width: 100%; clear: both;"> <img class="left" alt="Img1" src="img1.jpg" alt="" width="242" height="181" /> <img class="right" alt="Img2" src="img2.jpg" alt="" width="242" height="181" /> </div> <div> <p> This text appears between those images. I want it to display below them.</p> </div>

Float: center doesn't work?

坚强是说给别人听的谎言 提交于 2019-12-22 10:48:53
问题 I'm doing my first Tumblr theme using a tutorial, I'm a total newbie at this. .metadata a { display: inline-block; float: center; margin-left: 2%; } I want the posts to be centered, but the only things that work are float: left and float: right What should I do ? Please explain clearly because as I said, I'm a total newbie, and I'm not a native English speaker. 回答1: You can only float left or right, so float is not an option here. Add text-align: center to the parent element of the a-tag.

Does CSS3 offer a better way to have a two column website with header and footer, equal height columns and stretchy column widths?

╄→尐↘猪︶ㄣ 提交于 2019-12-22 10:44:40
问题 I wrote a website a while ago that is a little messy in how it does things. I used this CSS template and this equal height columns trick. I have not one but two container divs and I can't remember what they're doing. This seems unsatisfactory. So I'm thinking of restructuring the thing from scratch, and possibly making use of the more "semantic" html5 tags like <nav> and so on. I'm wondering if there are CSS3 type things I can do today that will improve the code. The question is: is there a

IE8 float issue with CSS

你。 提交于 2019-12-22 10:04:03
问题 I'm sure this must have been covered before because I'm sure I'm not the first to do this, but I can't find the answer. I am creating a shadow effect for a <div> using repeated background images. In the bottom two corners I use small 9x5 px images. I float them left and right and in Firefox and Safari they look perfect. In IE8 (and possibly other IEs) they float too far to the left and right about about 3px. You can see the issue at here. It's an ebay template for my wife. Thus far I've tried

How can a float design achieve this table-like result?

◇◆丶佛笑我妖孽 提交于 2019-12-22 09:46:57
问题 I'm usually a Web technologies enthusiast, and I'm all for the no-tables-design thing, but right now, it's somewhat pissing me off. :/ I'm trying to achieve something that would have been extremely easy with tables, but that seems overly complex/impossible using floating elements. Look at the following: +-----------------+ +-------+ | | | | | #contents | | #info | | | | | | | +-------+ +-----------------+ Where #info has a fixed width, and must be floating right to #contents . #contents

Filling space between floating elements

十年热恋 提交于 2019-12-22 08:41:04
问题 I have container div (gray box) with floating elements inside: Bars are floating to the left and button if floating to the right. Now I want textbox to fill the empty space between the bars and the button. Please note that bars count may vary during typind so textbox should be able to resize accordingly. So solutions with static widths (even if they are expressed in %) will not work. How can I do it? EDIT: Here's my code: HTML: <div id="dp-container"> <ol id="tag-list"> <li dp-item class="dp

Filling space between floating elements

不问归期 提交于 2019-12-22 08:40:02
问题 I have container div (gray box) with floating elements inside: Bars are floating to the left and button if floating to the right. Now I want textbox to fill the empty space between the bars and the button. Please note that bars count may vary during typind so textbox should be able to resize accordingly. So solutions with static widths (even if they are expressed in %) will not work. How can I do it? EDIT: Here's my code: HTML: <div id="dp-container"> <ol id="tag-list"> <li dp-item class="dp