Answer the question
In order to leave comments, you need to log in
Why is the link full width of the page?
There are links that are wrapped in a container, but they still stretch to the full width of the screen. If you write display: inline-block; they (links) slide down below the footer and cannot be raised through the margin. What could be the problem?
My NewsBlock class
<?php
if ($Module == 'category' and $_GET['id'] != 1 and $_GET['id'] != 2 and $_GET['id'] != 3) MessageSend(1, 'Такой категории не существует.', '/news');
$Param['page'] += 0;
Head('Новости');
?>
<body>
<div id="wrapper">
<?php Menu();
MessageShow()?>
<?php
if ($_SESSION['USER_GROUP'] == 2) echo '<a href="/news/add"><div class="button15">Добавить новость</a></div>'
?>
<?php
if (!$Module or $Module == 'main') {
$Param1 = 'SELECT `id`, `name`, `added`, `date` FROM `news` ORDER BY `id` DESC LIMIT 0, 5';
} else if ($Module == 'category') {
$Param1 = 'SELECT `id`, `name`, `added`, `date` FROM `news` WHERE `cat` = '.$_GET['id'].' ORDER BY `id` DESC LIMIT 0, 5';
}
$Query = mysqli_query($CONNECT, $Param1);
while ($Row = mysqli_fetch_assoc($Query)) echo '<a href="/news/material/?id='.$Row['id'].'"><b><div class="NewsBlock"></b><span>'.$Row['name'].'</span>Добавил: '.$Row['added'].' | '.$Row['date'].' </div></a>';
?>
</div>
.NewsBlock {
background: #f2f2f2;
padding: 10px;
color: #000000;
margin: 10px;
border-radius: 2px;
font-size: 1.2em;
height: 50px;
width: 50%;
border: 1px solid black;
margin-left: 26%;
margin-top: 30px;
border-radius: 2px;
color: green;
overflow: hidden;
font-family: 'Roboto Slab', serif;
}
Answer the question
In order to leave comments, you need to log in
Tags are closed incorrectly.
<a>
<div class="button15">Добавить новость</a> //?
</div>
а
, then opened the div, closed а
it, and then closed the div, we must first close the div inside.<a>
<b><div class="NewsBlock"></b>
<span></span>
</div>
</a>
<a>
<div class="button15">Добавить новость</div>
</a>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question