Программисты Html
Anonymous
Как избавиться от белой границы вокруг страницы в HTML и CSS [дублировать]
Сообщение
Anonymous » 08 апр 2025, 17:06
I'm having an issue where there's a white border around the page (around the image that's supposed to occupy the background), I've tried setting border to 0 in a few elements and that has not helped.
I'm also not sure how to alter the style to make all the elements of the navigation bar the same size, so if there's any suggestions for that, please share.
Код: Выделить всё
.topnav { /* navigation bar */
overflow: hidden;
position: absolute;
top: 0;
border: 0;
width: 100vw;
height:auto;
}
.title {
font-family: 'loveloblack';
border: 4px;
font-size: 28px;
float: center;
}
.topnav a { /* the objects inside the navigation bar */
float: left;
color: #000000;
text-align: center;
padding: 14px 24px;
text-decoration: none;
font-size: 36px;
border: 0;
font-family: 'opensansregular';
width: 10vw;
height: auto;
}
.background { /* the background div */
position: relative;
width: 100vw;
height: auto;
overflow: hidden;
border: 0;
}
a.image {
overflow: hidden;
}
a.image img{
width: 100%;
height: auto;
}
.topnav a:hover {
background-color: #ddd;
color: black;
}
.topnav a.active {
background-color: #04AA6D;
color: white;
}
< /code>
[img]background.PNG[/img]
[url=#home]
[img]logo.PNG[/img]
[/url]
[url=#events]Events[/url]
[url=#donate]Donate[/url]
[url=#contact]Contact[/url]
[url=#forvendors]For Vendors[/url]
Title
Подробнее здесь:
https://stackoverflow.com/questions/795 ... ml-and-css
1744121194
Anonymous
I'm having an issue where there's a white border around the page (around the image that's supposed to occupy the background), I've tried setting border to 0 in a few elements and that has not helped. I'm also not sure how to alter the style to make all the elements of the navigation bar the same size, so if there's any suggestions for that, please share. [code] .topnav { /* navigation bar */ overflow: hidden; position: absolute; top: 0; border: 0; width: 100vw; height:auto; } .title { font-family: 'loveloblack'; border: 4px; font-size: 28px; float: center; } .topnav a { /* the objects inside the navigation bar */ float: left; color: #000000; text-align: center; padding: 14px 24px; text-decoration: none; font-size: 36px; border: 0; font-family: 'opensansregular'; width: 10vw; height: auto; } .background { /* the background div */ position: relative; width: 100vw; height: auto; overflow: hidden; border: 0; } a.image { overflow: hidden; } a.image img{ width: 100%; height: auto; } .topnav a:hover { background-color: #ddd; color: black; } .topnav a.active { background-color: #04AA6D; color: white; } < /code> [img]background.PNG[/img] [url=#home] [img]logo.PNG[/img] [/url] [url=#events]Events[/url] [url=#donate]Donate[/url] [url=#contact]Contact[/url] [url=#forvendors]For Vendors[/url] Title [/code] Подробнее здесь: [url]https://stackoverflow.com/questions/79562266/how-to-get-rid-of-a-white-border-around-the-page-in-html-and-css[/url]