You use floats. See:
http://alistapart.com/articles/journey/
http://glish.com/css/
Code:
#box1 {
width: 400px;
float: left;
}#box2 {
width: 400px;
float: left;
}
Code:
<div id="box1">Sup</div>
<div id='box2">Homies!</div>
Login |
CSS/div FAQCSS/div FAQCurrently viewing this thread: 1 (0 members and 1 guests) You use floats. See:
Use separate style sheets for basic formatting and layout. Use point (pt) for font sizes, not pixel (px). Base font sizes off your paragraph font size and remember that paragraph and header 4 are the same, except header 4 is bold. This is what I am currently working with and it works great for sizes.
Since people new to CSS post that they still "don't get DIVs," I thought I'd post some beginner information. First, there are two main types of elements (tags) in HTML: 1) Block-level elements, and 2) Inline elements. Block elements are displayed on a different line from all other elements if no CSS styling is applied. Inline elements are rendered one after another until the browser needs to wrap them to a separate line. Common inline elements include text, images embedded via the <img> tag, <b>, <i> and <span> A <div> literally means a "division" of the page. It was meant to group inline and block elements together. By default DIVs have no styling, i.e. no padding, margins, borders, fonts, background colors, etc. They also represent very little meaning about the content inside them. That's why you should never place text DIRECTLY inside a DIV tag. Instead, do something like:
The following is valid code:
This next chunk would not validate:
Again, this is because DIV tags have little semantic value. A DIV tag doesn't say much about the content inside it, at least, not nearly as much as a <p> tag, which means the following block of text is a paragraph. Once a DIV is floated left or right, it becomes ONLY as wide as the longest unwrapped line of text and only has high as it needs to be. The exeption to the rule is Internet Explorer 5.x/Mac, which still gives the floated DIV as much width as possible. Now that you know DIVs group elements together, you can come up with HTML like:
Doing this requires fewer ID and CLASS attributes in your HTML code and helps to keep that code cleaner and easier to read. And a final note: DIVs can be given virtually any CSS property. You can style them in any way. ___________________ I can't believe you just hit that car! AR8Status: Offline!
But, how do you make <div>'s with scrollbars as if it were an iFrame? And transparent scrollbars are impossible with <div>'s, right?
Use the overflow CSS property to achieve this effect.
You shouldn't be changing scrollbar colors in the first place. // freak ___________________ Tables for layout is an abuse. -- Internet Explorer is unsafe. More specifically, overflow: auto;
In fact they're easier than iframes. You apply the filter to the div and that's it. But it's recommended to leave the scrollbar as it is. why is everyone so against changing the color of scroll bars?.:confused: |
Copyright ©1999-2008 Neverside. All rights reserved.
Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach
NeverAPI generated this page in 0.0096 seconds.