开发者

Aligning lines in CSS

Help a CSS newbie out here. What I'm trying to do is very simple.

Aligning lines in CSS

As I said in the image, I want the text to be in the same line. I tried everything i could think of.

Here is the index.php: h开发者_Python百科ttp://pastebin.com/9LVVFgUZ Here is the style.css: http://pastebin.com/v8Eius2A

Thanks.


Original code:

.box_con a {
    color: #111111;
    font-family: Georgia,"Times New Roman",Times,serif;
    font-size: 16px;
    padding-left: 14px;
    text-decoration: none;
    width: 470px;
}

Remove the float, make the a element block-level and add a left margin like so:

.box_con a {
    color: #111111;
    display: block;
    font-family: Georgia,"Times New Roman",Times,serif;
    font-size: 16px;
    margin-left: 150px;
    padding-left: 14px;
    text-decoration: none;
    width: 470px;
}

Result:

Aligning lines in CSS


Adding to .box_con a these rules: float: left and width: 470px seems to get what you asked for in your image.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜