Button is unclickable - possible causes? - html

I've made a button for my page, but it is not clickable. The pointer doesn't even appear. Why does it happen? How can I fix it?
Also, did I center the .intro and #more correctly? I feel like there is a better way than this which would also be more responsive, but I'm not sure. Some tips would be great!
Thanks a lot.
/*Continut centru*/
#continut {
padding-top: 250px;
font-family: 'Roboto Condensed', sans-serif;
width: 100%;
user-select: none;
pointer-events: none;
}
#intro {
text-transform: uppercase;
color: #77dff1;
font-size: 300px;
text-align: center;
}
.intro {
position: absolute;
top: 60%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 24px;
text-align: center;
display: table-cell;
vertical-align: middle;
max-width: 700px;
margin: 0 auto;
line-height: 30px;
}
/*Buton MORE*/
#more {
position: absolute;
top: 75%;
left: 50%;
transform: translate(-50%, -50%);
background-color: transparent;
border: #77dff1 2px solid;
text-align: center;
text-decoration: none;
padding: 15px;
display: inline-block;
font-size: 2rem;
color: #fff;
font-family: 'Roboto Condensed', sans-serif;
}
<div id="continut">
<h1 id="intro">hi</h1>
<h6 class="intro">asdf</h6>>
<button type="button" href="#" id="more">More...</button>
</div>

Your parent div #continut has pointer-events as none and that's the reason the default mouse-event of button to is none, to override you could you !important rules.
/*Continut centru*/
#continut {
padding-top: 250px;
font-family: 'Roboto Condensed', sans-serif;
width: 100%;
user-select: none;
pointer-events: none;
}
#intro {
text-transform: uppercase;
color: #77dff1;
font-size: 300px;
text-align: center;
}
.intro {
position: absolute;
top: 60%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 24px;
text-align: center;
display: table-cell;
vertical-align: middle;
max-width: 700px;
margin: 0 auto;
line-height: 30px;
}
/*Buton MORE*/
#more {
position: absolute;
top: 75%;
left: 50%;
transform: translate(-50%, -50%);
background-color: transparent;
border: #77dff1 2px solid;
text-align: center;
text-decoration: none;
padding: 15px;
display: inline-block;
font-size: 2rem;
color: #fff;
font-family: 'Roboto Condensed', sans-serif;
pointer-events: auto !important;
/* Add this */
}
<div id="continut">
<h1 id="intro">hi</h1>
<h6 class="intro">asdf</h6>
<button type="button" href="#" id="more">More...</button>
</div>

/*Continut centru*/
#continut {
padding-top: 250px;
font-family: 'Roboto Condensed', sans-serif;
width: 100%;
user-select: none;
}
#intro {
text-transform: uppercase;
color: #77dff1;
font-size: 300px;
text-align: center;
}
.intro {
position: absolute;
top: 60%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 24px;
text-align: center;
display: table-cell;
vertical-align: middle;
max-width: 700px;
margin: 0 auto;
line-height: 30px;
}
/*Buton MORE*/
#more {
position: absolute;
top: 75%;
left: 50%;
transform: translate(-50%, -50%);
background-color: transparent;
border: #77dff1 2px solid;
text-align: center;
text-decoration: none;
padding: 15px;
display: inline-block;
font-size: 2rem;
color: #fff;
font-family: 'Roboto Condensed', sans-serif;
z-index: 1;
cursor: pointer;
}
<div id="continut">
<h1 id="intro">hi</h1>
<h6 class="intro">asdf</h6>>
<button type="button" href="#" id="more">More...</button>
</div>

Related

why is the layout of my website different on mobile?

I'm trying to make a simple website for a homework.
This is how the site looks like on google chrome.
At first, I used px instead of '%' for my website, then changed it because turned out it looked different on different browsers. After I used '%', I was satisfied because it looked the same, but then I tried to open it on my phone's google chrome and this is how it looks
I tried using the meta viewport, but that only made it worse. All the element overlaps with each other. My friends didn't use any media queries and their sites still looked alright on both mobile and desktop (fonts looked smaller and everything, but the layout was still alright).
here's the css code:
<style>
.header{
background-image: url("https://www.blibli.com/friends/assets/masakan-indonesia-featured-696x464.jpg");
position: absolute;
height: 25%;
width: 99%;
text-align: center;
filter: blur(2px);
-webkit-filter: blur(2px);
}
.headertext{
font-family: Bebas Neue;
font-size: 4.5em;
top: 7%;
left: 28%;
position: absolute;
color: white;
z-index: 1;
text-decoration: none;
}
/* Add a black background color to the top navigation */
.topnav {
background-color: chocolate;
overflow: hidden;
position: absolute;
width: 99%;
top: 26.5%;
}
/* Style the links inside the navigation bar */
.topnav a {
float: left;
display: block;
color: white;
text-align: center;
padding: 1% 9.92%;
text-decoration: none;
font-size: 1.373em;
font-family: Roboto;
}
/* Change the color of links on hover */
.topnav a:hover {
background-color: #ddd;
color: black;
}
/* Add an active class to highlight the current page */
.topnav a.active {
color: white;
}
/* Hide the link that should open and close the topnav on small screens */
.topnav .icon {
display: none;
}
.sidebar{
width: 20%;
height: 107%;
float: left;
display: block;
top: 40%;
position: absolute;
background-color: rgba(148, 145, 141, 0.37);
}
.main{
width: 76.3%;
height: 220%;
display: block;
position: absolute;
top: 40%;
left: 23%;
background-color: rgba(148, 145, 141, 0.37);
}
.box{
border:1px solid red;
position:absolute;
width:80%;
height:22%;
left: 5%;
transition: 0.2s;
}
.box:hover{
transform: scale(1.05);
}
.top{
top: 3%;
}
.middle{
position: absolute;
top: 31%;
}
.bottom{
position:absolute;
bottom:19%
}
.picture{
object-fit: cover;
width: 50%;
height: 85%;
position: absolute;
top: 7.5%;
left: 3%;
}
.text {
width: 40%;
height: 80%;
position: absolute;
top: 7.5%;
right: 4%;
font-family: Roboto;
font-size: 0.9em;
text-align: justify;
}
.judul{
font-family: Bebas Neue;
font-size: 1.6em;
line-height: 2;
letter-spacing: 0.3em;
}
.link{
bottom: 0px;
position: absolute;
font-family: Roboto;
font-size: 0.7em;
}
.button{
text-decoration: none;
display: inline-block;
padding: 1.5% 10%;
position: absolute;
bottom: 7%;
left: 35%;
font-family: Roboto;
font-size: 1.2em;
}
.button:hover{
background-color: white;
color: black;
}
.more{
background-color: chocolate;
color: white
}
.rekomendasi{
display: block;
position: absolute;
width: 96%;
height: 5%;
font-size: 1.8em;
font-family: Bebas Neue;
padding: 2%;
background-color: chocolate;
text-align: center;
letter-spacing: 0.1em;
color: white;
}
.rekomendasicontent{
position: absolute;
top: 85%;
font-size: 0.6em;
text-align: left;
font-family: Roboto;
letter-spacing: 0em;
color: black;
line-height: 160%;
}
.populer{
display: block;
position: relative;
top: 49%;
width: 96%;
height: 5%;
font-size: 1.8em;
font-family: Bebas Neue;
padding: 2%;
background-color: chocolate;
letter-spacing: 0.1em;
color: white;
text-align: center;
}
.populercontent{
font-size: 0.6em;
text-align: left;
font-family: Roboto;
letter-spacing: 0em;
position: absolute;
top:85%;
color: black;
line-height: 160%;
}
.link2{
color: black;
text-decoration: none;
background-color: none;
}
li{
transition: 0.2s;
}
li:hover{
transform: scale(1.1);
}
.footer{
width: 97.8%;
position: absolute;
top: 260%;
background-color: chocolate;
font-family: Roboto;
font-size: 1em;
color: white;
text-align: center;
padding: 0.5%;
}
</style>

Extra whitespace on mobile version of website

I've trying to make a website just for a home project but having some trouble with the css for mobile.
There seems to be a lot of whitespace surrounding the elements to the right and bottom of the site. I'm newer to the world of CSS so any help would be appreciated.
Screenshot of what chrome shows in developer mode.
#media screen and (max-width:450px) {
body {
margin: 0 0 0 0;
padding: 0 0 0 0;
max-width: 100vw;
overflow-x: hidden;
}
html{scroll-behavior:smooth}
.navbar {
background-color: #008B8B;
position: fixed;
top: 0;
z-index: 100;
width: 100vw;
}
.navbar a {
text-decoration: none;
display: inline-block;
float: center;
padding-bottom: 20px;
}
.logo{
display: none;
}
.loginLogo{
width = 1px;
height = 1px;
visibility: hidden;
}
.navbar-name{
color: #f2f2f2;
font-size:25px;
padding-left: 25%;
font-family: 'Lobster', cursive;
}
.navbar-home{
font-size: 17px;
padding-top: 5px;
padding-right: 10px;
float: right;
font-family: 'Titillium Web', sans-serif;
color: #f2f2f2;
}
.navbar-products{
font-size: 17px;
padding-top: 5px;
padding-right: 10px;
float: right;
font-family: 'Titillium Web', sans-serif;
color: #f2f2f2;
}
.navbar-about{
font-size: 17px;
padding-top: 5px;
padding-right: 10px;
float: right;
font-family: 'Titillium Web', sans-serif;
color: #f2f2f2;
}
.navbar-contact{
font-size: 17px;
padding-top: 5px;
padding-right: 17.5%;
float: right;
font-family: 'Titillium Web', sans-serif;
color: #f2f2f2;
}
.navbar-login{
font-size: 1px;
padding-top: 1px;
float: right;
font-family: 'Titillium Web', sans-serif;
color: #f2f2f2;
visibility: hidden;
}
/* Change the color of links on hover */
.navbar-home:hover {
color: black;
}
.navbar-products:hover {
color: black;
}
.navbar-about:hover {
color: black;
}
.navbar-contact:hover {
color: black;
}
.navbar-login:hover {
color: black;
}
/* Add a color to the active/current link */
.navbar a.active {
background-color: #4CAF50;
color: white;
}
/*--------HOME PAGE------------*/
.homePage{
margin: 0 0 0 0;
padding: 0;
width: 100vw;
height: 820px;
background-image: url(multiGrain.jpg);
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.homePageH1{
position: absolute;
text-align: center;
overflow: hidden;
white-space: nowrap;
top: 26%;
left:50%;
transform: translateX(-50%) translateY(-50%);
font-size: 40px;
color: white;
}
.homePageH2{
position: absolute;
text-align: center;
display: inline;
top: 28%;
left: 50%;
text-align: center;
transform: translateX(-50%) translateY(-50%);
font-size: 20px;
color: white;
white-space: nowrap;
overflow-x: auto;
overflow-y: hidden;
display: inline-block;
}
.aboutUsButton{
position: absolute ;
text-align: center;
top: 31%;
left:30%;
padding: 10px;
padding-right: 20px;
padding-left: 20px;
transform: translateX(-50%) translateY(-50%);
background-color: rgb(0, 159, 159);
border-radius: 25px;
font-family: 'Titillium Web', sans-serif;
color: #f2f2f2;
text-decoration: none;
}
.ourProductsButton{
position: absolute ;
text-align: center;
white-space: nowrap;
overflow-x: auto;
overflow-y: hidden;
display: inline-block;
top: 31%;
left:70%;
padding: 10px;
padding-right: 18px;
padding-left: 18px;
transform: translateX(-50%) translateY(-50%);
background-color: rgb(0, 159, 159);
border-radius: 25px;
font-family: 'Titillium Web', sans-serif;
color: #f2f2f2;
text-decoration: none;
}
/*-------ABOUT US PAGE----------*/
.aboutUsPage{
margin: 0 0 0 0;
padding: 0px;
background-color: white;
height: auto;
width: 100%;
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.aboutUsH1{
position: relative;
padding-top: 20px;
padding-left: 20px;
margin: 0px;
text-align: left;
display: block;
width: 90%;
top: 20%;
font-size: 20px;
font-family: 'Lobster', cursive;
color: black;
background-color: rgb(255,255,255);
}
.aboutUsP{
position: relative;
padding-top: 20px;
padding-left: 20px;
padding-bottom: 30px;
margin: 0px;
text-align: left;
float: bottom;
display: block;
width: 90%;
top: 5%;
font-size: 15px;
font-family: 'Lobster', cursive;
color: black;
background-color: rgb(255,255,255);
}
.mixerImage{
position: relative;
object-fit: cover;
width: 100%;
height: 150px;
}
/*--------PRODUCTS PAGE------------*/
.productsPage{
position: relative;
margin: 0px;
padding: 0px;
background-color: white;
height: 300px;
width: auto;
}
.productsH1{
position: relative;
text-align: left;
top: 5%;
left: 4%;
font-size: 25px;
font-family: 'Titillium Web', sans-serif;
color: black;
}
.productsP{
position: relative;
padding: 10px;
padding-top: 15px;
text-align: left;
float: inherit;
width: 45%;
left: 2%;
font-size: 15px;
font-family: 'Titillium Web', sans-serif;
color: black;
background-color: white;
}
.productListButton{
position: absolute ;
text-align: center;
left: 2%;
padding: 10px;
padding-right: 20px;
padding-left: 20px;
background-color: black;
border-radius: 25px;
font-family: 'Titillium Web', sans-serif;
letter-spacing: 5px;
color: white;
text-decoration: none;
}
.slideshowImage1{
position: absolute;
width: auto;
left: 55%;
top: 15%;
height: 100px;
float: right;
margin: 10px;
padding: 10px;
box-shadow: 0 0 20px rgba(0,0,0,0.4);
}
.slideshowImage2{
width = 0px;
height = 0px;
visibility: hidden;
}
/*-------CONTACT US PAGE---------*/
.contactPage{
margin: 0 0 0 0;
padding: 0px;
background-image: url(rollingPin2.JPG);
height: 700px;
width: 100%;
background-repeat: no-repeat;
background-size: cover;
background-size: 200% 100%;
}
.contactH1{
position: relative;
text-align: center;
overflow: hidden;
white-space: nowrap;
top: 10%;
left:0%;
font-size: 70px;
letter-spacing: 3px;
color: white;
font-family: 'Dancing Script', cursive;
}
.contactP1{
position: relative;
text-align: center;
top: 10%;
left:0%;
font-size: 18px;
color: white;
font-family: 'Slabo 27px', serif;
}
.contactP2{
position: relative;
text-align: center;
top: 10%;
left:0%;
font-size: 18px;
color: white;
font-family: 'Slabo 27px', serif;
}
.contact-form{
position: relative;
top: 15%;
width: 80%;
left: 47.5%;
transform: translateX(-50%);
}
input[type=text], select, textarea {
width: 100%; /* Full width */
padding: 12px; /* Some padding */
border: 1px solid #ccc; /* Gray border */
font-family: 'Titillium Web', sans-serif;
border-radius: 4px; /* Rounded borders */
margin-top: 6px; /* Add a top margin */
margin-bottom: 16px; /* Bottom margin */
resize: none; /* Allow the user to vertically resize the textarea (not horizontally) */
}
/* Style the submit button with a specific background color etc */
input[type=submit] {
width: 105%;
background-color: #008B8B;
color: white;
padding: 12px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
}
/* When moving the mouse over the submit button, add a darker green color */
input[type=submit]:hover {
background-color: black;
}
.nameInput{
position: relative;
top: 0px;
color: white;
}
.emailInput{
position: relative;
top: 5px;
color: white;
}
.messageInput{
position: relative;
top: 5px;
color: white;
}
.submitButton{
position: relative;
top: 5px;
}
/*--------FOOTER---------*/
.facebookLogo{
width: 0%;
height: 0%;
visibility: hidden;
}
.footer {
width: 0px;
height: 0px;
visibility: hidden;
}
.footerp1{
width: 0px;
height: 0px;
visibility: hidden;
}
.footerp2{
width: 0px;
height: 0px;
visibility: hidden;
}
.footerp3{
width: 0px;
height: 0px;
visibility: hidden;
}
}
<!DOCTYPE html>
<html>
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=yes">
<link href="https://fonts.googleapis.com/css2?family=Titillium+Web:wght#600&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Lobster&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Dancing+Script&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Slabo+27px&display=swap" rel="stylesheet">
<title>Doughboys Bakery</title>
<link href="StyleSheet.css" rel="stylesheet">
</head>
<body>
<header class="site-header">
<nav class="navbar">
<img class = "logo" src="Doughboys Logo - Website Version.png" alt="Logo" width="80"height="45.109">
<a class="navbar-name" href="">Doughboy's Bakery.</a>
<a class="navbar-login" href="">Log In</a>
<img class = "loginLogo" src="loginLogo2.png" onmouseover="this.src='loginLogo2Black.png';" onmouseout="this.src='loginLogo2.png';" width="50"height="28.889"/>
<a class="navbar-contact" href="#contactPage">Contact</a>
<a class="navbar-products" href="#productsPage">Products</a>
<a class="navbar-about" href="#aboutUsPage">About</a>
<a class="navbar-home" href="#homePage">Home</a>
</nav>
</header>
<div class = "homePage" id="homePage">
<h1 class="homePageH1">Quality or Quantity</h1>
<h2 class="homePageH2">We're here to give you both</h2>
<div class = "homePageButtons">
<a class="aboutUsButton" href="#aboutUsPage">About Us</a>
<a class="ourProductsButton" href="#productsPage">Our Products</a>
</div>
</div>
<div class = "aboutUsPage" id="aboutUsPage">
<div class = "aboutUsText">
<h1 class="aboutUsH1">Who we are.</h1>
<p class="aboutUsP">Doughboys Bakery is a locally owned and operated wholesale bakery located near the city centre of Palmerston North. We produce traditional bakery goods like the classic Mince and Cheese Pies and Custard Squares. <br/><br/>We deliver actively in the Manawatu-Whanganui, Horowhenua & Wairarapa regions. (T's & C's Apply)<br/><br/>Use the contact section below to see how we can help suit your baking needs.</p>
</div>
</div>
<div class = "productsPage" id="productsPage">
<h1 class="productsH1">What we make.</h1>
<p class="productsP">At Doughboys' we supply traditionally sold bakery goods all the way from the classic Mince and Cheese Pie to the humble Scone.</p>
<button class="productListButton" type="submit" onclick="window.open('ProductList.doc')">Full Product List</button>
<div id="slideshow">
<div>
<img class="slideshowImage1" src="fruitPies.jpeg">
</div>
<div>
<img class="slideshowImage2" src="pies.jpg">
</div>
</div>
</div>
<div class="contactPage" id="contactPage">
<h1 class="contactH1">Contact Us.</h1>
<p class="contactP1">ADDRESS: 15 Johnston St </p>
<p class="contactP2">TEL: (06) 123 1234 | doughboys#gmail.net.nz</p>
<div class = "contact-form">
<form id = "contact-form" method="post" action="contactForm.php">
<input class= "nameInput" type="text" id="name" name="name" placeholder="Your name...">
<input class= "emailInput" type="text" id="email" name="email" placeholder="Your email...">
<textarea class= "messageInput" id="message" name="message" placeholder="Write something..." style="height:100px"></textarea>
<input class= "submitButton" type="submit" value="Submit">
</form>
</div>
</div>
<div class="footer">
<a href="https://www.facebook.com/Doughboys-Bakery-Ltd-216199385212667">
<img class = "facebookLogo" src="facebookLogo.png" >
</a>
<p class="footerp1">(06) 123 1234</p>
<p class="footerp2">doughboys#gmail.net.nz</p>
<p class="footerp3">15 Johnston St</p>
</div>
</body>
</html>

Can't Scroll on Website

Today, i've been playing with some scratch css and html. But one thing bugs my mind and it's that i can't scroll on the website, it just won't let me. I'll provide you with a html and css.
<html>
<head>
<title>Website</title>
<link rel="stylesheet" href="css/mystyle.css">
<html lang ="en"></html>
</head>
<body>
<!-- NAVBAR -->
<div class="navbar">
<div class="navbarposition">
<div class="lists">
Home<span></span>
Contact<span></span>
About<span></span>
Blog<span></span>
</div>
</div>
</div>
<div class="banner">
<h1 class="headingbanner">Web Development</h1>
Read More
</div>
<div class="offerings">
<h3 class="secondheader">My Services</h3>
<div class="jobnumber1">
<img class="cloudphoto" src="http://www.iconsdb.com/icons/preview/orange/cloud-3-xxl.pngf">
<h3 class="thirdheader">Web Development</h3>
<p class="pjob">I'm Fully able to build you a website that is going to handle the traffic.<br>Price: 300 USD <br></p>
</div>
</div>
<div class="randomquote">
</div>
</body>
And there goes the css
#import url('https://fonts.googleapis.com/css?family=Encode+Sans');
body{
margin: 0px;
padding: 0px;
width: 100%;
height: 100%;
overflow: scroll;
}
.navbar{
background: #22264b;
height: 80px;
margin-top: -20px;
padding: 20px 10 10 20;
}
.navbarposition{
text-align: right;
margin: 20px;
margin-top: 20px;
}
.listo{
color: #e6cf8b;
text-decoration: none;
font-size: 25px;
margin: 20px;
font-family: 'Encode Sans', sans-serif;
}
.lists{
padding: 20px;
}
.listo:hover{
color: crimson;
}
.img-container{
text-align: center;
}
.banner{
text-align: center;
}
.content{
text-align: center;
}
.banner{
margin-top: -20px;
width: 100%;
height: 500px;
position: fixed;
top: 100px;
background: url(https://i.stack.imgur.com/21f6K.jpg);
background-position: fixed;
background-size: cover;
}
.headingbanner{
color: white;
font-size: 120px;
margin-top: 140px;
font-family: 'Encode Sans', sans-serif;
opacity: 1;
z-index: 10;
}
.btn{
border: 2px solid white;
color: white;
padding: 12px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
margin: 4px 2px;
-webkit-transition-duration: 0.4s;
transition-duration: 0.4s;
cursor: pointer;
font-size: 25px;
font-family: 'Encode Sans', sans-serif;
border-radius: 5px;
opacity: 1;
z-index: 10;
}
.btn:hover{
background: white;
color:black;
}
.offerings{
margin-top: -20px;
width: 100%;
height: 400px;
position: fixed;
top: 600px;
background:#22264b;
background-position: fixed;
background-size: cover;
align-content: center;
}
.secondheader{
text-align: center;
font-size: 45px;
color:white;
font-family: 'Encode Sans', sans-serif;
}
.cloudphoto{
display: block;
margin: auto;
height: 120px;
}
.jobnumber1{
align-content: center;
}
.thirdheader{
font-family: 'Encode Sans', sans-serif;
color:white;
font-size: 25px;
text-align: center;
}
.pjob{
font-family: 'Encode Sans', sans-serif;
color:darkgoldenrod;
text-align: center;
font-size: 15px;
}
.randomquote{
margin-top: -20px;
width: 100%;
height: 200px;
top: 1000px;
position:fixed;
background:url(https://i.stack.imgur.com/S4bDF.jpg);
background-position: fixed;
background-size: cover;
align-content: center;
}
I would really appreciate if someone would be so kind to look through the code and help me in finding the way to debug this.
It's because you are using a fixed position on every single wrapper.
Information on positions, https://www.w3schools.com/css/css_positioning.asp
You can just remove the positions and the margins you used to end up with the result you are hoping for.
You only have to change your CSS,
#import url('https://fonts.googleapis.com/css?family=Encode+Sans');
body{
margin: 0px;
padding: 0px;
width: 100%;
height: 100%;
overflow: scroll;
}
h1, h2, h3, h4, h5{
-webkit-margin-before: 0em;
-webkit-margin-after: 0em;
-webkit-margin-start: 0em;
-webkit-margin-end: 0em;
}
.navbar{
background: #22264b;
height: 80px;
margin-top: -20px;
padding: 20px 10 10 20;
}
.navbarposition{
text-align: right;
margin: 20px;
margin-top: 20px;
}
.listo{
color: #e6cf8b;
text-decoration: none;
font-size: 25px;
margin: 20px;
font-family: 'Encode Sans', sans-serif;
}
.lists{
padding: 20px;
}
.listo:hover{
color: crimson;
}
.img-container{
text-align: center;
}
.banner{
text-align: center;
}
.content{
text-align: center;
}
.banner{
margin-top: -20px;
width: 100%;
height: 500px;
top: 100px;
background: url(https://i.stack.imgur.com/21f6K.jpg);
background-position: fixed;
background-size: cover;
}
.headingbanner{
color: white;
font-size: 120px;
font-family: 'Encode Sans', sans-serif;
opacity: 1;
z-index: 10;
}
.btn{
border: 2px solid white;
color: white;
padding: 12px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
margin: 4px 2px;
-webkit-transition-duration: 0.4s;
transition-duration: 0.4s;
cursor: pointer;
font-size: 25px;
font-family: 'Encode Sans', sans-serif;
border-radius: 5px;
opacity: 1;
z-index: 10;
}
.btn:hover{
background: white;
color:black;
}
.offerings{
margin-top: -20px;
width: 100%;
height: 400px;
top: 600px;
background:#22264b;
background-position: fixed;
background-size: cover;
align-content: center;
}
.secondheader{
text-align: center;
font-size: 45px;
color:white;
font-family: 'Encode Sans', sans-serif;
}
.cloudphoto{
display: block;
margin: auto;
height: 120px;
}
.jobnumber1{
align-content: center;
}
.thirdheader{
font-family: 'Encode Sans', sans-serif;
color:white;
font-size: 25px;
text-align: center;
}
.pjob{
font-family: 'Encode Sans', sans-serif;
color:darkgoldenrod;
text-align: center;
font-size: 15px;
}
.randomquote{
margin-top: -20px;
width: 100%;
height: 200px;
top: 1000px;
background:url(https://i.stack.imgur.com/S4bDF.jpg);
background-position: fixed;
background-size: cover;
align-content: center;
}

CSS3 Icon: inserted content isn't placed consistently

I'm creating icons using only CSS3. So far so good, but I've run into a problem with the simplest one.
I just want to have an "!" centered in a circle, but its position isn't consistent. Sometimes it's a pixel higher, a pixel to the left, or both.
I have no idea what's causing this.
Here's a fiddle.
.nos {
position: relative;
height: 12px; width: 12px;
border: 2px solid #e04006;
border-radius: 50%; -webkit-border-radius: 50%; -moz-border-radius: 50%;
display: block;
color: #e04006;
overflow: hidden;
cursor: default;
}
.nos:hover {
overflow: visible;
}
.nos span {
position: absolute;
padding-left: 18px;
display: block;
font-size: 14px; line-height: 16px; text-decoration: underline;
white-space: nowrap;
}
.nos:before {
content: '\21';
position: absolute; top: 0; bottom: 0; left: 0; right: 0;
margin: 0;
height: 16px; width: 16px;
display: block;
font-family: "Lucida Console", Monaco, monospace; text-align: center; font-size: 12px; line-height: 12px; font-weight: bold;
}
Remove the height: 16px; width: 16px; from .nos:before
Update Fiddle
Looks like I managed to fix it after some tinkering. Not sure what did the trick.
.nos {
position: relative;
width: 12px; height: 12px;
border: 2px solid #e04006;
-webkit-border-radius: 50%; -moz-border-radius: 50%; border-radius: 50%;
display: inline-block;
color: #e04006;
overflow: hidden;
cursor: default;
}
.nos:hover {
overflow: visible;
}
.nos span {
position: absolute; top: -2px; left: -2px;
height: 16px;
padding-left: 18px;
display: block;
text-decoration: underline; font-size: 14px; line-height: 16px;
white-space: nowrap;
}
.nos:before {
content: '\21';
position: absolute; top: -2px; left: -2px;
width: 16px;
display: block;
font-family: Verdana, Geneva, sans-serif; text-align: center; font-weight: bold; font-size: 13px; line-height: 13px;
}
Fiddle

vertically center text with difference sizes

I'm trying to create a match div, which show match information. However they should all be different sizes and it does not seem like it wants to center properly. I want all these text to be centered in the middle of the div? how can this be done?
.saperator {
margin-right: 17px;
vertical-align: text-bottom;
color: #787878;
}
.result-in-month {
padding: 25px 20px;
background: #efefef;
margin-bottom: 10px;
border-radius: 4px;
border: none;
transition: all 0.45s ease-in-out 0s;
position: relative;
}
.result-in-month:hover {
background: #FFF;
box-shadow: 0px 0px 3px 1px #e5e5e5;
}
.result-in-month {
padding: 20px 30px;
font-size: 15px;
}
.result-date {
display: inline-block;
width: 12%;
margin-right: 2%;
font-size: 12px;
font-weight: 400;
text-transform: uppercase;
line-height: 40px;
}
.result-stream {
display: inline-block;
width: 12%;
text-transform: uppercase;
line-height: 40px;
text-align: right;
color: #212121;
font-size: 36px;
}
.result-stream a:hover {
text-decoration: none;
}
.result-match-team-wrapper {
display: inline-block;
width: 72%;
text-align: center;
text-transform: uppercase;
line-height: 40px;
font-weight: normal;
font-size: 18px;
}
.result-match-versus {
padding: 0px 3px;
font-weight: normal;
color: #999999;
}
.result-match-team.left {
margin-right: 2.5%;
text-align: right;
}
.result-match-team.right {
margin-left: 2.5%;
text-align: left;
}
.result-match-team {
display: inline-block;
width: 40%;
}
.result-match-separator {
margin: 0px 2.5%;
}
#nav {
margin-left:0px !important;
}
#nav li {
display: inline-block;
padding: 4px 11px;
background-color: #fff;
margin-right: 6px;
}
#nav li a {
color: #000;
text-decoration: none;
text-transform: uppercase;
font-size: 18px;
font-weight: 400;
font-family: Oswald, Impact, sans-serif !important;
}
#nav li.active {
background-color: #000;
}
#nav li.active a {
color: #fff;
}
<div class="result-in-month">
<div class="result-date">
SLUT
</div>
<div class="result-match-team-wrapper">
<span class="result-match-team left">
TEAM 3
</span>
<span class="result-match-versus">
VS
</span>
<span class="result-match-team right">
TEAM 1
</span>
</div>
<div class="result-stream">
<span class="result-match-score" >2</span><span class="result-match-separator">-</span><span class="result-match-score">1</span>
</div>
<div class="clear"></div>
</div>
You could let the inner divs behave like table cells and then vertical align them.
div {
border: 1px solid grey;
}
.match-header {
display: table;
width: 100%;
height: 300px;
}
.v-center {
vertical-align: middle;
display: table-cell;
}
.player-a {
font-size: 3em;
text-align: center;
}
.player-b {
font-size: 6em;
text-align: center;
}
.score {
font-size: 1em;
text-align: center;
}
<div class="match-header">
<div class="player-a v-center">
Ann
</div>
<div class="score v-center">
5 vs 6
</div>
<div class="player-b v-center">
Bob
</div>
</div>
I would probably change the structure of your HTML but this should see you on the right track with what you've got.
Updated fiddle
You can use absolute positioning on the children elements of your result-in-month class like so
.result-date{
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 12%;
margin-right: 2%;
font-size: 12px;
font-weight: 400;
text-transform: uppercase;
}
.result-match-team-wrapper {
position: absolute;
top: 50%;
transform: translateY(-50%);
display: inline-block;
width: 94%;
text-align: center;
text-transform: uppercase;
line-height: 40px;
font-weight: normal;
font-size: 18px;
}
.result-stream{
position: absolute;
top: 50%;
right: 5%;
transform: translateY(-50%);
display: inline-block;
width: 12%;
text-transform: uppercase;
line-height: 40px;
text-align: right;
color: #212121;
font-size: 36px;
}
Do you mean something like this ?
https://jsfiddle.net/wgrLfxg3/4/
Because you are using elements you only declared the font and size in nav but not the rest of elements
add the follow to the other elements and it will work fine. Take a look to the fiddle
font-size: 18px;
font-weight: 400;
font-family: Oswald, Impact, sans-serif !important;