Jeg har denne kode:
- echo "<div class=\"top\"><b>News</b></div>";
- <div class=\"info\">";
- $query = mysql_query("SELECT * FROM news ORDER BY id");
- if(mysql_num_rows($query)) {
- while ($row = mysql_fetch_array($query, MYSQL_ASSOC)) {
- ?>
- <div class="news_margin">
- <div class='news_top'>
- <div class='news_news_h1'>
- <a href='news.php?news_id=<?php echo $row['id']; ?>'><?php echo $row['news']; ?></a>
- </div>
- </div>
- <div class='news_message'>
- <div class='news_message_margin'>
- <?php echo $row['message']; ?>
- </div>
- </div>
- </div>
- <?php
- }
- }
- echo "</div>";
Og denne:
- .top {
- background: #202121;
- color: #ffffff;
- border-bottom: 1px solid #000;
- padding: 8px;
- border-top-left-radius: 0.5em;
- border-top-right-radius: 0.5em;
- -webkit-border-top-left-radius: 0.5em;
- -webkit-border-top-right-radius: 0.5em;
- -moz-border-radius-topleft: 0.5em;
- -moz-border-radius-topright: 0.5em;
- }
- .info {
- background: #dcdbdc;
- color: #000000;
- border-top: 1px solid #fff;
- border-bottom: 1px solid #bbb;
- padding: 6px;
- font-size: 12px;
- }
- .news_margin {
- margin-left: 10px;
- margin-right: 10px;
- margin-top: 10px;
- width: 40%;
- }
- .news_top {
- background: #f5f5f5;
- padding: 0;
- padding-left: 10px;
- border-top-left-radius: 0.5em;
- border-top-right-radius: 0.5em;
- -webkit-border-top-left-radius: 0.5em;
- -webkit-border-top-right-radius: 0.5em;
- -moz-border-radius-topleft: 0.5em;
- -moz-border-radius-topright: 0.5em;
- }
- .news_news_h1 {
- font-size: 24px;
- font-weight: bold;
- }
- .news_message {
- background: #FFFFFF;
- padding-left: 10px;
- border-bottom-left-radius: 0.5em;
- border-bottom-right-radius: 0.5em;
- -webkit-border-bottom-left-radius: 0.5em;
- -webkit-border-bottom-right-radius: 0.5em;
- -moz-border-radius-bottomleft: 0.5em;
- -moz-border-radius-bottomright: 0.5em;
- }
- .news_message_margin {
- padding-top: 10px;
- padding-bottom: 10px;
- }
Hvordan får jeg den ind der?
Indlæg senest redigeret d. 31.08.2011 20:27 af Bruger #16662