Bootstrap Sticky Footer - html

Whats the best way to get the footer im trying to make always stick to the bottom of the page no matter how much or how little text it on the page. I have tried several different ideas but with the new bootstrap it doesn't want to cooperate. I have tried fixed and it is not what I'm wanting.
Im wanting the bottom black footer bar to always align to the bottom of the page.
My CSS:
/* Chrome Frame Prompt
-------------------------------------------------- */
.chromeframe{ margin: .2em 0; background: #ECCC5B; color: #000000; margin-top: -55px; margin-bottom: 55px; padding: .2em 0; z-index: -100 ; text-align :center; }
/* Bootstrap Styles
-------------------------------------------------- */
.navbar-inverse { background-color: #3A3A3A; border-color: #3A3A3A; }
.navbar-inverse .navbar-brand { color: #BE1E2D; font-weight: bold; margin-top: 12px; padding-left: 40px; }
.navbar-inverse .navbar-toggle { margin-top: 20px; }
.navbar-inverse .navbar-nav>li>a { color: #FFFFFF; height: 75px; padding-top: 28px; }
.navbar-inverse .navbar-nav>li>a:hover { color: #BE1E2D; }
.navbar-inverse .navbar-nav>.open>a, .navbar-inverse .navbar-nav>.open>a:hover, .navbar-inverse .navbar-nav>.open>a:focus { color: #BE1E2D; }
.dropdown-menu { background-color: #080808; border: none; border-radius: 0; -webkit-box-shadow: none; box-shadow: none; }
.dropdown-menu>li>a { line-height: 1.6; color: #FFFFFF; }
.dropdown-menu>li>a:hover { line-height: 1.6; color: #BE1E2D; }
/* Main Styles
-------------------------------------------------- */
html, body { position: relative; min-height: 100%; }
body { -webkit-font-smoothing: antialiased; font: normal 16px/1.5; color: #232525; padding-top: 50px; padding-bottom: 20px; }
.logo { float: left; }
.logo:hover { }
.main-container { padding-bottom: 100px; }
.main-row { padding-top: 15px; }
.footer { position: absolute; color: #999999; background-color: #000000; bottom: 0; width: 100%; height: 100px; }
.logo-footer { float: left; margin-top: 13px; }
.footer-nav { color: #999999; display: block; float: left; margin: 40px 0 0 15px; }
.footer-copy { float: right; margin: 40px 0 0 0; text-align: left; }
/* RESPONSIVE CSS
--------------------------------------------------*/
#media (max-width:1150px) {
}
#media (max-width:900px) {
}
#media (max-width:767px) {
.navbar-inverse .navbar-nav>li>a { height: 40px; padding-top: 11px; }
.footer-copy { float: none; text-align: center; }
}
#media (max-width:340px) {
}

A solution is to ensure your content is always at least the height of the screen, this will cause the footer to be pushed to the bottom of the screen if the window is large enough.
Wrap your page content (excluding footer) in another <div> and in its style, set min-height to 100%
The downside of this is that the footer now hangs off the window constantly, to fix that, allow the footer to "sink" back up into the content by setting margin-bottom to negative the size of the footer (i.e if your footer is 50px, margin-bottom: -50px).
Another quirk you'll find after that is the footer may overlap the page content, to fix that, insert an element into the wrapper div from earlier and make its height that of the footer.
For example:
body, html {
height: 100%;
margin: 0;
}
.wrapper {
min-height: 100%;
margin-bottom: -50px;
}
.push {
height: 50px;
}
.footer-pad {
height: 50px;
}
<div class="wrapper">
<div class="container>
Some content
</div>
<div class="footer-pad"></div>
</div>
<div class="footer">Footer</div>
A couple of important things to note are the html, body must be set to 100% height, and the body must have no margin or you'll get a constant scrollbar
http://jsfiddle.net/XJDLk/

I used this in my recent boostrap site. Hope it helps.
HTML
<div class="footer_wrapper">
<div class="container">
<div class="col-md-3 col-sm-3">
content
</div>
<div class="col-md-3 col-sm-3">
content
</div>
<div class="col-md-3 col-sm-3">
content
</div>
<div class="col-md-3 col-sm-3">
content
</div>
</div>
</div>
css
.footer_wrapper {
min-height: 270px;
background-color: #232323;
color: #8f8f8f;
bottom: 0;
padding-top: 0px;
width: 100%;
}

Related

How can I create a topnav beside a sidenav I've already created?

For context, I'm practically making a reskin of Twitter. At least as of right now, that's what it is. I've created a sidenav already, and I want to add a topnav beside it. Something like this: image
I want to put "you - following - discover | profile" as the topnav.
I tried to go off of w3schools code for a topnav, but it didn't work. It just had a gray bar at the top with no buttons.
<div class="topnav">
<a class="active" href="#home">Home</a>
News
Contact
About
</div>
For context, I didn't add any buttons or change them originally but I don't think that would change anything. The sidenav is ontop of the topnav, and I want the topnav to be beside it.
My sidenav html:
<div class="sidenav">
<img src="./img/Aero Textual Icon Green.png" class="icon-sidenav" alt="Aero Icon Top Sidenav" style="cursor:default">
<span class="material-symbols-rounded inline-icon">home</span>Timeline
<span class="material-symbols-rounded inline-icon">notifications</span>Notifications
<span class="material-symbols-rounded inline-icon">near_me</span>Explore
<span class="material-symbols-rounded inline-icon">bookmark</span>Saved
<span class="material-symbols-rounded inline-icon">sms</span>Messages
<span class="material-symbols-rounded inline-icon">person</span>Profile
<span class="material-symbols-rounded inline-icon">settings</span>Settings
<span class="material-symbols-rounded inline-icon">more_horiz</span>More
<button>Post</button>
</div>
The pages css (All of its a sidenav and topnav right now):
.material-symbols-rounded {
font-variation-settings:
'FILL' 0,
'wght' 500,
'GRAD' -25,
'opsz' 48
}
.material-symbols-rounded-high {
font-variation-settings:
'FILL' 0,
'wght' 700,
'GRAD' 0,
'opsz' 48
}
body {
font-family: 'Coda', cursive;
background-color: #212121;
color: #fff;
}
.main {
margin-left: 160px;
font-size: 28px;
padding: 0px 10px;
}
.sidenav button {
font-family: 'Rajdhani', sans-serif;
font-weight: 600;
font-size: 23px;
margin-top: 25px;
margin-left: 163px;
border-radius: 50px;
width: 230px;
height: 55px;
background-color: #2EFFA8;
text-align: center;
color: #212121;
border: none;
text-decoration: none;
}
.sidenav button:hover {
background-color: #27d88e;
}
.icon-sidenav {
padding-top: 30px;
padding-bottom: 35px;
width: 170px;
display: block;
margin-left: auto;
margin-right: auto;
}
.inline-icon {
vertical-align: bottom;
font-size: 32px !important;
padding-right: 15px;
}
.sidenav {
height: 100%;
width: 550px;
position: fixed;
z-index: 1;
top: 0;
left: 0;
background-color: #181818;
overflow-x: hidden;
padding-top: 20px;
}
.sidenav a.sidebarbtn {
padding-top: 15px;
padding-bottom: 15px;
padding-left: 200px;
text-decoration: none;
font-size: 22px;
color: #ffffff;
display: block;
}
.sidenav a:hover {
color: #2EFFA8;
cursor: pointer;
}
.sidenav a:active {
color: #2EFFA8;
}
.sidenav a.split {
float: left;
color: white;
}
.topnav {
background-color: #333;
overflow: hidden;
}
.topnav a {
float: left;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
.topnav a:hover {
background-color: #ddd;
color: black;
}
.topnav a.active {
background-color: #04AA6D;
color: white;
}
#media screen and (max-height: 450px) {
.sidenav {padding-top: 15px;}
.sidenav a {font-size: 18px;}
}
This question doesn't work because the result is for topnav above sidenav, I want the topnav to the right of the sidenav
I can't find a question asking to put a topnav beside a sidenav, I've looked on here and around 5 other places.
you can change your top nav to display:flex, and justify its content to center, as follwing:
or you can make your layout more strict by using display grid and modifying the follwing (recommended):
.sidenav {
height: 100%;
width: 550px;
/* position: fixed; */
background-color: #181818;
overflow-x: hidden;
padding-top: 20px;
/*The following line says that this element spans for two rows*/
grid-row: 1/-1;
}
body{
display: grid;
padding: 0 15% 0 15%;
grid-template-columns: min-content max-content;
grid-template-rows: min-content max-content;
justify-content: left;
}
the result would be something like:
and then to make nav bars fixed in place, you can add another div after the top nav and make it scroll on overflow-y and you can hide its scrollbar if u want to.
finally i think grid would be the best choice to achieve your overall goal for the layout.
plz upvote if this helps.
Thanks

Place several divs one after another width full width and adjusted width and height for image background

I want to show the divs #botone, #bottwo and #botthree one after the other. I also want to have the background image to be adjusted by 100% width and proportional height on #botone div.
Now the last two Divs show up behind the #botone Div and the #botone div adds the 49px to the vertical placement that comes from the .topnav Div.
I also want to fixate the .topnav Div on top.
** body {
margin: 0px 0px;
}
/* Add a black background color to the top navigation */
.topnav {
background-color: #000;
overflow: hidden;
height: 49px;
}
/* Style the links inside the navigation bar */
.topnav a {
float: right;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
/* Change the color of links on hover */
.topnav a:hover {
background-color: #ddd;
color: black;
}
/* Add a color to the active/current link */
.topnav a.active {
background-color: #4CAF50;
color: white;
}
.block {
float: left;
width: 40px;
}
.blocka {
float: right;
width: 250px;
}
#botone {
position: absolute;
height: 100%;
width: 100%;
background-image: url("arc.jpg");
background-size: cover;
}
#bottwo {
background-color: blue;
height: 400px;
width: 100%;
}
#botthree {
background-color: yellow;
height: 600px;
width: 100%;
}
<div class="topnav">
<div class="block">
Oi
</div>
<div class="blocka">
News
Contact
About
</div>
</div>
<div id="botone">testtext
</div>
<div id="bottwo">testtext
</div>
<div id="botthree">testtext
</div>
If I understand your question correctly, does this accomplish what you're trying to do?
HTML:
<div class="topnav">
<div class="block">
Oi
</div>
<div class="blocka">
News
Contact
About
</div>
</div>
<div id="botone">testtext
</div>
<div id="bottwo">testtext
</div>
<div id="botthree">testtext
</div>
CSS: (Changes at bottom)
body {
margin: 0px 0px;
}
/* Add a black background color to the top navigation */
.topnav {
background-color: #000;
overflow: hidden;
height: 49px;
}
/* Style the links inside the navigation bar */
.topnav a {
float: right;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
/* Change the color of links on hover */
.topnav a:hover {
background-color: #ddd;
color: black;
}
/* Add a color to the active/current link */
.topnav a.active {
background-color: #4CAF50;
color:white;
}
.block { float:left;width: 40px; }
.blocka { float:right;width: 250px; }
#botone {
position: absolute;
height: 100%;
width: 100%;
background-image: url("arc.jpg");
background-size: cover;
}
#bottwo {
background-color:blue;
height: 400px;
width: 100%;
}
#botthree {
background-color:yellow;
height: 600px;
width: 100%;
}
/*--- Fixes --*/
.topnav {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 5;
}
#botone {
/*-- Test --*/
background-image: url("https://images.pexels.com/photos/948358/pexels-photo-948358.jpeg?auto=compress&cs=tinysrgb&h=650&w=940");
background-position: center;
height: 100vh;
margin-top: 49px;
position: relative;
}
link to example
A little confused with your requirements description but I think this is what you're trying to achieve:
.topnav {
background-color: #000;
overflow: hidden;
height: 49px;
position:fixed; //add this
width:100%; //add this
}
#botone {
position: absolute;
margin-top: 49px; //add this
height: 100%;
width: 100%;
background-image: url("arc.jpg");
background-size: cover;
}
To fixate the top nav or header, use position:fixed. You would have to define the width as 100% or it automatically takes a width: auto.
To ensure the following div shows directly under the fixed element, give it a margin-top corresponding to the height of the fixed element. If you are using SCSS, this would be much better in responsive design, since you can create a function that applies the height to the margin-top at the same time. But if you are using CSS, just check your #media queries to make sure the height and the margin-top are consistent.
At the moment the blue element is your element that follows the fixed element. If you want to add something in between the blue element and the header (i.e. a slideshow, or banner) treat is as the blue element is being treated now. Give this the margin-top and remove it from the blue element, since the blue element is no longer directly under the fixed header.
See DEMO
Or the whole code in the snippet
body {
margin: 0px 0px;
}
/* Add a black background color to the top navigation */
.topnav {
background-color: #000;
overflow: hidden;
height: 49px;
position:fixed;
width:100%;
top:0;
}
/* Style the links inside the navigation bar */
.topnav a {
float: right;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
/* Change the color of links on hover */
.topnav a:hover {
background-color: #ddd;
color: black;
}
/* Add a color to the active/current link */
.topnav a.active {
background-color: #4CAF50;
color: white;
}
.block {
float: left;
width: 40px;
}
.blocka {
float: right;
width: 250px;
}
#botone {
position: absolute;
margin-top: 49px;
height: 100%;
width: 100%;
background-image: url("arc.jpg");
background-size: cover;
}
#bottwo {
background-color: blue;
height: 400px;
width: 100%;
}
#botthree {
background-color: yellow;
height: 600px;
width: 100%;
}
<div class="topnav">
<div class="block">
Oi
</div>
<div class="blocka">
News
Contact
About
</div>
</div>
<div id="botone">testtext
</div>
<div id="bottwo">testtext
</div>
<div id="botthree">testtext
</div>

All new HTML appears behind an image?

I have been working on a responsive web design, after adding CSS to make a link stay centered on a an image the webpage now displays any new html behind the image. I want to be able to add more things on my webpage but any new html I write disappears.
Link to JSFIDDLEhttps://jsfiddle.net/R4bbit2k17/7yuL4y1p/1/#&togetherjs=MEzytpw3kf`
Because your .banner-inner is using position: absolute in conjunction with taking up 100% of the width and height, you'll need to set a position other than static for your text element(s), along with giving them a z-index greater than the default of 0:
p {
background: red; /* Purely to highlight the text */
position: relative;
z-index: 1;
}
This causes your text to appear on top of your image, and can be seen in the following:
body {
font-family: helvetica;
font-size: 15px;
line-height: 1.5;
padding: 0;
margin: 0;
background-color: #f4f4f4;
}
header {
background: black;
color: white;
padding-top: 20px;
min-height: 45px;
}
header a {
color: white;
text-decoration: none;
text-transform: uppercase;
font-size: 16px;
}
header ul {
margin: 0;
padding: 0;
}
header li {
float: left;
display: inline;
padding: 0 20px 0 20px;
}
header nav {
float: right;
margin-top: 5px;
}
#media only screen and (max-width:1000px) {
.centered {
font-size: 12pt!important;
}
}
#media only screen and (max-width:800px) {
.centered {
font-size: 11pt!important;
}
}
#media only screen and (max-width:600px) {
.centered {
font-size: 10pt!important;
}
}
#media only screen and (max-width:400px) {
.centered {
font-size: 9pt!important;
}
}
#media only screen and (max-width:200px) {
.centered {
font-size: 8pt!important;
}
}
.banner-inner {
width: 100%;
height: 100%;
position: absolute;
text-align: center;
color: white;
}
.centered {
position: absolute;
margin-left: auto;
margin-right: auto;
width: 100%;
height: auto;
margin-top: 20%;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
font-size: 12pt;
}
.img {
width: 100%;
height: auto;
float: left;
}
p {
background: red;
position: relative;
z-index: 1;
}
<body>
<header>
<div id="header-inner">
<nav>
<ul>
<li>Home</li>
<li>Courses</li>
<li>About</li>
</ul>
</nav>
</div>
</header>
<section class="section-1">
<div class="banner-inner">
<img class="img" alt="" src="https://d2mt0dng9y3p4j.cloudfront.net/newandimproved/wp-content/uploads/2016/12/shop-with-a-sheriff-mockup.jpg">
<div class="centered">Start Learning</div>
</div>
</section>
<p>ANY HTML ADDED APPEARS BEHIND THE IMAGE AND I CANNOT FIGURE OUT HOW TO CHANGE IT TO APPEAR BENEATH THE IMAGE AS IT WOULD WITH A FRESH HTML PAGE</p>
</body>
Hope this helps!

HTML margins squishing when viewed on Mobile device

I tried to use a couple of posts that were here for resizing for mobile devices but i can't seem to get it working. The margins keep pushing all the elements together when you view the site on a mobile device
/* TEXT FORMATTING */
.introPar1 {
border-radius: 5px;
background-color: #f2f2f2;
padding: 20px;
margin-left: 400px;
margin-right: 400px;
font-size: 30px;
}
.introPar1 h1 {
text-align: center;
}
.contacts {
border-radius: 5px;
background-color: #f2f2f2;
padding: 20px;
margin-left: 400px;
margin-right: 400px;
font-size: 30px;
}
/* MOBILE FORMATTING */
#media (max-width: 1100px) {
introPar1 {
margin-right: 20px;
`enter code here`margin-left: 20px;
}
}
#media (max-width: 750px) {
body {
margin-right: 5vw;
margin-left: 5vw;
}
}
#media (max-width: 500px) {
body {
margin-right: 2vw;
margin-left: 2vw;
}
}
You are seeing this page on mobile devices like this
You need to change like this
then increase the nav bar width
(I tried width: 1520px; for Nav beacuse that is the background image size you were used)
There are a bunch of problems with your code. But the problem with the menu is because li is not taking the height of a. So the list items will stack one under another, and will li under li. Li being smaller than a.
Use display:block on a.
Also, I copied the code from your site, so it will be here if someone else comes looking for this answer. Tried to clean it up a bit but you have some styles that i don't understand, like .introPar1 { margin-left:400px;margin-right:400px}
Anyway, see code below
body img {
max-width: 100%;
height: auto;
}
/* TOP NAVIGATION */
nav ul li a {
text-decoration: none;
margin: 20px;
padding: 20px;
border-style: solid;
border-color: grey;
display: block;
}
nav ul li {
float: left;
}
nav ul {
list-style-type: none;
float: left;
}
nav {
background-color: #f2f2f2;
padding: 10px;
float: left;
width: 100%;
box-sizing: border-box;
}
/* NAV HOVER */
nav a:hover {
background-color: blue;
border-color: orange;
border-style: solid;
color: white;
transition: .3s;
}
/* BANNER */
.banner {
text-align: center;
}
.banner img {
border-style: solid;
border-width: 10px;
border-color: #87CEEB;
}
/* BODY ELEMENTS */
.home {
font-weight: bold;
font-size: 20px;
}
.temp {
text-align: center;
margin: auto;
padding: 20px;
}
/* BACKGROUND */
.bgimage img {
pointer-events: none;
position: absolute;
width: 100%;
height: 100%;
z-index: -1;
opacity: 0.5;
position: fixed;
}
/* TEXT FORMATTING */
.introPar1 {
border-radius: 5px;
background-color: #f2f2f2;
padding: 20px;
font-size: 30px;
}
.introPar1 h1 {
text-align: center;
}
.contacts {
border-radius: 5px;
background-color: #f2f2f2;
padding: 20px;
font-size: 30px;
}
/* MOBILE FORMATTING */
#media (max-width: 1100px) {
introPar1 {
margin-right: 20px;
margin-left: 20px;
}
}
#media (max-width: 750px) {
body {
margin-right: 5vw;
margin-left: 5vw;
}
nav ul li a {
margin: 5px;
padding: 10px;
}
}
#media (max-width: 500px) {
body {
margin-right: 2vw;
margin-left: 2vw;
}
nav ul li {
width: 100%;
}
}
<div class="bgimage">
<img src="http://via.placeholder.com/1200x1000">
</div>
<nav>
<ul>
<li class="home">Crafts LLC</li>
<li>About Us</li>
<li>Contact Us</li>
</ul>
</nav>
<div class="banner"><img src="http://via.placeholder.com/350x150"></div>
<div class="Intro">
<article class="introPar1">
<h1><b><u>CRAFTS LLC</u></b></h1>
<br> Here at CRAFTS LLC, we offer you our 45 years of expertise of
<br> home repair advisory and remodeling services
<br>
<br> We are also here to help you with your estimation service needs
<br> and contractor referral services
<br>
<br> With CRAFTS LLC, you get both service and quality excellence.
<br> You need to look no further for your home repair and remodeling needs/solutions
<br>
</article>
</div>
<div class="contacts">
<p>Email to: craftsllc1#gmail.com or Call:813 347 7458</p>
</div>

white space div when i add text in the middle

im getting a white space when im putting text into the div. How to remove that ? i would like to ask you aswell how to make the text "welkom op dennis website" automatic center in the middle of the div.
here you can see the code :
.container {
max-width: 100%;
max-width: 100%;
margin: 0;
padding: 0;
display: inline-block;
}
html,
body {
margin: 0px;
padding: 0px;
}
.nav {
height: 5%;
width: 100%;
background-color: white;
}
.top {
height: 40%;
width: 100%;
background-color: #1E90FF;
}
.nav {
background-color: #444;
}
.nav a {
display: inline-block;
background-color: #444;
font-family: Arial;
padding: 10px 20px;
text-decoration: none;
color: white;
float: right;
}
.nav a:hover {
background-color: #1E90FF;
}
.logo {
color: white;
display: inline-block;
padding: 10px 20px;
font-family: Arial;
text-decoration: none;
}
p.center {
padding: 150px 550px;
color: white;
font-family: Arial;
font-size: 25px;
{}
<header>
<title>Dennis Zwart Home Pagina</title>
<link href="css/MyStyle.css" rel="stylesheet" style="css" />
</header>
<body>
<div class="container">
<div class="nav">
<text class="logo">Dennis Zwart</text>
Contact
Games
Foto's
Hobby's
Home
</div>
<div class="top">
<p class="center">Welkom op de website van Dennis Zwart</p>
</div>
</div>
</body>
The space between your navigation and blue text field is from collapsing margins. You'll need to remove the margins created by your <p> element in .top, more on Collapsing Margins.
If you need the text vertically centered as well, you can use relative positioning and translate.
Other Notes
<text> is not a valid HTML element, use <p>, <span>, <div>, <a> etc. instead. I switched it to an <a> in my answer.
I see that you're using percentage heights. Those can be tricky. In order for percentage heights to work a height has to be set on the parent element. If that parent element's height is a percentage, then it's parent needs a height set. So on and so forth all the way to the root element <html> if percentages are used. In my answer I switch the heights to px values.
A number of block level elements (<div>, <nav>) had width: 100%; applied to them, I removed them as they're not needed. A block level element will always take up 100% width of it's containing element by default.
To vertically center your navigation items I set the line-height of the <a> elements equal to the height of the <nav> element.
I removed your .container element as it wasn't doing anything useful. You might need it later (likely in a different location) if you decide to add media queries and limit it's width for various viewport sizes.
html,
body {
margin: 0px;
padding: 0px;
}
.nav {
height: 45px;
background-color: white;
}
.top {
height: 300px;
background-color: #1E90FF;
}
.nav {
background-color: #444;
}
.nav .logo {
float: left;
}
.nav a {
display: inline-block;
background-color: #444;
font-family: Arial;
padding: 0 20px;
text-decoration: none;
line-height: 45px;
color: white;
float: right;
}
.nav a:hover {
background-color: #1E90FF;
}
p.center {
position: relative;
top: 50%;
transform: translateY(-50%);
margin: 0;
color: white;
font-family: Arial;
font-size: 25px;
text-align: center;
}
<header>
<title>Dennis Zwart Home Pagina</title>
<link href="css/MyStyle.css" rel="stylesheet" style="css" />
</header>
<body>
<div class="nav">
<a class="logo" href="#">Dennis Zwart</a>
Contact
Games
Foto's
Hobby's
Home
</div>
<div class="top">
<p class="center">Welkom op de website van Dennis Zwart</p>
</div>
</body>
This is because p element has natural margins (defined by browser). Remove it:
p {
margin-top: 0;
}
Then remove the p horizontal padding and center your text with
text-align: center;
In order to remove the blank area on the right side of the screen.
p {
margin-top: 0;
text-align: center;
}
.container {
max-width: 100%;
max-width: 100%;
margin: 0;
padding: 0;
display: inline-block;
}
html,
body {
margin: 0px;
padding: 0px;
}
.nav {
height: 5%;
width: 100%;
background-color: white;
}
.top {
height: 40%;
width: 100%;
background-color: #1E90FF;
}
.nav {
background-color: #444;
}
.nav a {
display: inline-block;
background-color: #444;
font-family: Arial;
padding: 10px 20px;
text-decoration: none;
color: white;
float: right;
}
.nav a:hover {
background-color: #1E90FF;
}
.logo {
color: white;
display: inline-block;
padding: 10px 20px;
font-family: Arial;
text-decoration: none;
}
p.center {
padding: 150px 0px;
color: white;
font-family: Arial;
font-size: 25px;
}
<header>
<title>Dennis Zwart Home Pagina</title>
<link href="css/MyStyle.css" rel="stylesheet" style="css" />
</header>
<body>
<div class="container">
<div class="nav">
<text class="logo">Dennis Zwart</text>
Contact
Games
Foto's
Hobby's
Home
</div>
<div class="top">
<p class="center">Welkom op de website van Dennis Zwart</p>
</div>
</div>
</body>