1

So my font is not changing size or being center aligned. I've tried heaps of stuff but without results. I'd like the code (text) centered, but it currently is being aligned to the left. I'd also like the text to be a lot bigger. Please have a look at my code!

HTML

<head>
    <link rel="stylesheet" type="text/css" href="style.css">
</head>

...

<div class="qt">
    <?
        $filename = "quotes.txt";
        function RandomLine($filename) { 
            $lines = file($filename); 
            echo $lines[array_rand($lines)]; 
        } 
        echo RandomLine($filename);
    ?>
</div>
<div class="home">
    <a href="http://www.jonsnow.net/index.php" id="h1"></a>
    <a href="http://www.jonsnow.net/gallery/" id="h2"></a>
</div>

CSS

div.home a {
    float: left;
    display: inline;
}

div.home img {
    float: top;
    display: inline;
}

div.home {
    position: absolute;
    top: 20%;
    bottom: 0;
    left: 0;
    right: 0;
    width: 1000px;
    margin: auto;
}

div.qt {
    text-align: "center";
    font-family: "Vivaldi";
    font-size: "44 px";
    color: "#000000";
    position: absolute;
    top: -60%;
    bottom: 0;
    left: 0;
    right: 0;
    width: 1000px;
    margin: auto;
    height: 62px;
    display: inline;
}

div.home #h1 {
    width:  500px;
    height: 350px;
    display: inline;
    background-image: url('header1.jpg');
}

div.home #h1:hover {
    background-image: url('header1hover.jpg');
}

div.home #h2 {
    width:  500px;
    height: 350px;
    display: inline;
    background-image: url('header2.jpg');
}

div.home #h2:hover {
    background-image: url('header2hover.jpg');
}
4

3 回答 3

2

去掉引号

center

在你的 CSS 中。以及字体大小和颜色。

于 2013-05-11T23:45:14.033 回答
1

将其更改为:

div.qt {
    text-align: center;
    font-family: Vivaldi;
    font-size: 44px;
    color: #000000;
    position: absolute;
    top: -60%;
    bottom: 0;
    left: 0;
    right: 0;
    width: 1000px;
    margin: auto;
    height: 62px;
    display: inline;
}
于 2013-05-11T23:45:37.123 回答
0

我注意到它的另一个问题,在 div.home img {} 你有 float:top; 你不能浮动元素顶部,你要么有左,右,无或继承

于 2013-05-12T00:12:41.420 回答