Css text-and-text mixed layout code

Source: Internet
Author: User

In this article, the css text-and-text mixed layout style code is very helpful for beginners. Let's take a look at what styles are arranged first.

That's the effect. Now let's take a look at his css code.

The code is as follows: Copy code

<Div id = "ployMain">
<H4> <Dl>
<Dt> </dt>
<Dd class = "dishTitle"> chopped green peppers </dd>
<Dd class = "dishMain"> I have been thinking about the snacks in Huimin Street. While walking and eating, my stomach is round like a ball ..... </Dd>
<Dd class = "dishOn"> <a href = "#"> I want to comment> </a> </dd>
</Dl>
<Dl>
<Dt> </dt>
<Dd class = "dishTitle"> chopped green peppers </dd>
<Dd class = "dishMain"> I have been thinking about the snacks in Huimin Street. While walking and eating, my stomach is round like a ball ..... </Dd>
<Dd class = "dishOn"> <a href = "#"> I want to comment> </a> </dd>
</Dl>
           
</Div>

This is the figure above, which we wrote with css + div layout. Let's take a look at the style ployMain, dishTitle, dishMain, dishOn.

The code is as follows: Copy code

# PloyMain {
Float: left;
Width: 436px;
}
# PloyMain dl {
Padding-left: 20px;
Display: block;
Padding-top: 12px;
Clear: both;
Height: 100px;
}
# PloyMain dt {
Display: block;
Float: left;
Height: 90px;
Width: 120px;
Background-color: # E0E0E0;
Border: 1px solid # A4C934;
5
}
# PloyMain dt {
 
}

Dd. dishTitle {
Line-height: 22px;
Height: 22px;
Display: block;
Float: left;
Margin-left: 20px;
Color: # efa11c;
Font-weight: 700;
}
Dd. dishMain {
Display: block;
Width: 250px;
Float: left;
Line-height: 22px;
Margin-left: 20px;
Padding: 0px;
Margin-top: 0px;
Margin-right: 0px;
Margin-bottom: 0px;
Border-bottom-width: 1px;
Border-bottom-style: solid;
Border-bottom-color: # a4c934;
}
Dd. dishOn {
Display: block;
Float: left;
Height: 30px;
Width: 250px;
Line-height: 30px;
Margin-left: 20px;
Text-align: right;
}
Dd. dishOn {
Color: # CC0000;
}

Haha because it was made with the dw style controller. This site's original article www.111cn.net/cssdiv/css.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.