HTML/CSS Header Formatting Issue - html

I'm working a project which consists of creating a web application. Currently, I'm focusing on the general design and layout of the website. First of all, I want a horizontal dark grey header on the top. Below that, I want two columns, one with a navigation bar, and one with the content.
Actual result
Desired result
Below is my code and I'm not sure what's causing the issue of the dark header on top not showing up.
Full CSS file: https://pastebin.com/kpUHV71Z
<section class="management">
<div class="header-div">
<img src="Golf.png" class="management-logo" height="50" width="50">
<h1 class="impact" id="management-header">Management Dashboard</h1>
</div>
<div class="left left-nav">
<ul>
<li>Home</li>
<li>News</li>
<li>Contact</li>
<li>About</li>
</ul>
</div>
<div class="right">
<h3>Staff</h3>
</div>
<div class="clear"></div>
</section>

You need to assign a display and a width to your header
.header-div {
background-color: #555555;
border-radius: 5px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
height: auto;
width: 100%;
display: inline-block;
}
This will make the header behave as a block and let you navigation adjust
Hope this is what you were looking for. Happy to explain or help in a better solution if needed.
body {
text-align: center;
background-image: url("background.jpg");
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
font-family: verdana;
}
.selection-menu {
margin-top: 50px;
}
#special-button {
margin-top: 100px;
margin-left: 200px;
}
#special-button2 {
margin-top: 100px;
margin-left: 400px;
}
#header {
margin-top: 10px;
font-weight: bold;
font-size: 60px;
color: white;
}
#author {
font-weight: normal;
font-size: 25px;
margin-top: -40px;
color: white;
padding-bottom: 20px;
}
.club-selection {
font-weight: bold;
margin-top: 20px;
font-size: 50px;
}
.input-header {
font-weight: bold;
margin-top: 20px;
font-size: 50px;
}
.impact {
font-family: Montserrat;
}
.index-section {
background-color: rgb(242,242,242);
border-radius: 5px;
width: 50%;
margin: auto;
padding-bottom: 25px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
margin-top: 50px;
}
table {
border-collapse: collapse;
margin: auto;
margin-top: 10px;
}
table td, table th {
border: 1px solid lightgrey;
padding: 2px;
}
.management {
background-color: rgb(242,242,242);
border-radius: 5px;
width: 90%;
margin: auto;
padding-bottom: 25px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
margin-top: 50px;
}
h3 {
font-size: 40px;
font-family: Montserrat;
margin-bottom: 10px;
}
.separate {
width: 95%;
margin: auto;
margin-top: 20px;
margin-bottom: -30px;
}
.buttongroup {
display: inline;
}
input {
display: inline;
}
button {
background-color: #555555;
border: none;
color: white;
padding: 7px 16px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
border-radius: 5px;
}
button:hover {
background-color: lightgrey;
color: black;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
input {
border: none;
height: 3%;
}
#appdescription {
margin-top: 40px;
margin-bottom: -10px;
}
.inline-alignment {
display: inline;
margin-bottom: 20px;
}
img {
margin-left: 20px;
}
.header-div {
background-color: #555555;
border-radius: 5px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
height: auto;
width: 100%;
display: inline-block;
}
.left {
width: 25%;
float: left;
}
.right {
margin-left: 25%;
}
.clear {
clear: both;
}
.management-logo {
float: left;
clear: right;
margin-right: 20px;
}
#management-header {
margin-top: 10px;
font-weight: bold;
font-size: 30px;
color: white;
float: left;
margin: 0;
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
width: 200px;
background-color: grey;
}
li a {
display: block;
color: #000;
padding: 8px 16px;
text-decoration: none;
}
li a:hover {
background-color: #555;
color: white;
}
.left-nav {
background-color: grey;
}
<section class="management">
<div class="header-div">
<img src="Golf.png" class="management-logo" height="50" width="50">
<h1 class="impact" id="management-header">Management Dashboard</h1>
</div>
<div class="left left-nav">
<ul>
<li>Home</li>
<li>News</li>
<li>Contact</li>
<li>About</li>
</ul>
</div>
<div class="right">
<h3>Staff</h3>
</div>
<div class="clear"></div>
</section>

You have to left-floated elements (logo and title) and no clears on your header-div, so it effectively has zero height.
So adjust with a clearfix, or use inline-block or flexbox instead of floats.
.management-logo {
margin-right: 20px;
display:inline-block;
}
#management-header {
margin-top: 10px;
font-weight: bold;
font-size: 30px;
color: white;
margin: 0;
display:inline-block;
}
https://jsfiddle.net/49m5395n/13/

I really love display: flex; and thats why I recomend it for everyone. It isn't too much heavy and saves a LOT of styling. I sugest you to study it.
Anyway, here is my contribution:
body {
text-align: center;
background-image: url("background.jpg");
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
font-family: verdana;
}
.header {
display: flex;
background: #555;
}
.canvas {
display: flex;
}
.navigation {
width: 25%;
}
.content {
width: 75%;
}
/* YOUR CODE BELOW*/
.selection-menu {
margin-top: 50px;
}
#special-button {
margin-top: 100px;
margin-left: 200px;
}
#special-button2 {
margin-top: 100px;
margin-left: 400px;
}
#header {
margin-top: 10px;
font-weight: bold;
font-size: 60px;
color: white;
}
#author {
font-weight: normal;
font-size: 25px;
margin-top: -40px;
color: white;
padding-bottom: 20px;
}
.club-selection {
font-weight: bold;
margin-top: 20px;
font-size: 50px;
}
.input-header {
font-weight: bold;
margin-top: 20px;
font-size: 50px;
}
.impact {
font-family: Montserrat;
}
.index-section {
background-color: rgb(242, 242, 242);
border-radius: 5px;
width: 50%;
margin: auto;
padding-bottom: 25px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
margin-top: 50px;
}
table {
border-collapse: collapse;
margin: auto;
margin-top: 10px;
}
table td,
table th {
border: 1px solid lightgrey;
padding: 2px;
}
h3 {
font-size: 40px;
font-family: Montserrat;
margin-bottom: 10px;
}
.separate {
width: 95%;
margin: auto;
margin-top: 20px;
margin-bottom: -30px;
}
.buttongroup {
display: inline;
}
input {
display: inline;
}
button {
background-color: #555555;
border: none;
color: white;
padding: 7px 16px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
border-radius: 5px;
}
button:hover {
background-color: lightgrey;
color: black;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
input {
border: none;
height: 3%;
}
#appdescription {
margin-top: 40px;
margin-bottom: -10px;
}
.inline-alignment {
display: inline;
margin-bottom: 20px;
}
img {
margin-left: 20px;
}
.header-div {
background-color: #555555;
border-radius: 5px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
height: auto;
}
.left {
width: 25%;
float: left;
}
.right {
margin-left: 25%;
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
width: 200px;
background-color: grey;
}
li a {
display: block;
color: #000;
padding: 8px 16px;
text-decoration: none;
}
li a:hover {
background-color: #555;
color: white;
}
.left-nav {
background-color: grey;
}
<header class="header">
<img src="golf.png" height="50" width="50">
<h1 class="impact">Management Dashboard</h1>
</header>
<div class="canvas">
<div class="navigation">
<ul>
<li>Home</li>
<li>News</li>
<li>Contact</li>
<li>About</li>
</ul>
</div>
<div class="content">
<h3>Content</h3>
</div>
</div>

Related

My product grid is changing my layout of my site when I hover over it. How can I change this?

Currently for my site I am building a product grid that is supposed to show more information when you hover over it. But now when I hover over my product the layout of my site changes. How can I make it that it will show my information without changing the layout?
.home-products {
width: auto;
height: 250px;
}
.product-image-home {
height: 200px;
}
.product-grid {
position: relative;
float: left;
margin-left: 3px;
margin-right: 3px;
text-align: center;
width: 225px;
}
.product-grid h3 {
margin: 0;
text-align: center;
margin-bottom: 5px;
font-size: 20px "Open Sans", Helvetica, Arial, sans-serif;
}
.product-info p {
margin-left: 7px;
margin-right: 7px;
}
.product-overlay-button {
background: #85bf31;
border: none;
border-radius: 2px;
color: #fff;
font-weight: bold;
font-size: 14px;
padding: 0.6em 2em;
margin-top: 5px;
margin-bottom: 15px;
text-decoration: none;
text-align: center;
}
.product-grid:hover {
width: 225px;
height: 440px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
text-align: center;
float: left;
margin-left: 3px;
margin-right: 3px;
}
.product-info {
display: none;
}
.product-grid:hover .product-info {
display: block;
}
<div class="home-products">
<div class="product-grid">
<img class="product-image-home" src="https://cardpile.nl/wp-content/uploads/2021/04/blood-rage-460x460.jpg" alt="Homepage">
<h3>Bloodrage</h3>
<span>€38.90</span>
<div class="product-info">
<p>Some information text</p>
CTA
</div>
</div>
</div>

How to align articles on HTML5

I am creating a website for my school coding class using Adobe Dreamweaver, but I have run into an issue.
I have two articles and am trying to get them inline. They are both set to block, and I know that they should be inline-block elements, but setting it to that causes a problem.
I have a navigation bar above these two articles, and if I make these articles inline-block elements, it makes the navigation bar disappear. I don't know why this is happening, and have tried asking my teacher and classmates for help, but can't find a solution. Here is an image of what it looks like with both articles as block elements:
This is what it looks like when they are inline-block elements:
I want the articles to be together, as shown in the second image, but I still want to keep my navigation bar. Note that the navigation bar is styled with 'position:fixed', so that it always stays at the top of my page. I also want to keep this, but I feel as though it may be the cause for my problem. Here is a snippet of the code which I made (sorry if it doesn't work properly, and that the images don't work)
#import url('https://fonts.googleapis.com/css2?family=Limelight&display=swap');
#import url('https://fonts.googleapis.com/css2?family=Zen+Dots&display=swap');
nav {
height: 120px;
background-color: black;
width: 100%;
display: block;
margin: -130px 0 0 -10px;
position: fixed;
}
.dropdown {
padding-right: 5px;
margin-right: 5px;
}
.tasa {
text-transform: uppercase;
font-family: 'Limelight', cursive;
}
.nav-bar-image {
width: 110px;
height: 100px;
margin: 10px -10px 10px 10px;
display: inline;
}
nav>ul>li>a {
text-decoration: none;
color: white;
}
nav>ul>li {
font-size: 20px;
font-family: Zen Dots;
display: inline;
padding: 10px;
}
nav>ul>li:hover {
background-color: darkgrey;
}
nav>ul>li>ul {
display: none;
margin-top: 10px;
font-size: 14px;
margin-left: 165px;
list-style-type: none;
position: absolute;
}
nav>ul>li:hover>ul {
display: block;
}
nav>ul>li>ul>li {
padding-left: 10px;
padding-right: 69.5px;
}
nav>ul>li>ul>li:hover {
background-color: darkgrey;
}
nav>ul>li>ul>li>a {
color: white;
text-decoration: none;
}
nav>ul {
display: inline-block;
vertical-align: top;
margin-top: 20px;
list-style-type: none;
}
body {
background-image: url(background.jpg);
}
article {
background-color: rgba(255, 231, 179, 0.80);
width: 400px;
margin: 130px 0 0 10px;
/*130px 0 0 10px*/
padding: 5px 10px 10px;
height: 200px;
text-align: justify;
height: 750px;
display: block;
verticle-align: top;
}
.left {
border-top-left-radius: 50px;
border-bottom-left-radius: 50px;
height: 200px;
}
.centre {
margin-top: 0;
height: 200px;
}
h1 {
color: white;
font-family: Limelight;
font-size: 40px;
text-align: center;
margin: 10px 0 0;
}
p {
text-align: jusify;
color: white;
}
article>ul>li>a {
color: white;
text-decoration: none;
}
article>ul {
list-style-type: none;
}
::-webkit-scrollbar {
width: 16px;
}
::-webkit-scrollbar-thumb {
background: #ffe7b3;
border-radius: 8px;
}
::-webkit-scrollbar-track {
background: #ffffff;
box-shadow: inset 0 0 5px grey;
border-radius: 8px;
}
/*
::-webkit-scrollbar-button:single-button {
background-color: #ffffff;
display: block;
border-style: solid;
height: 13px;
width: 16px;
}
*/
::-webkit-scrollbar-thumb:hover {
background: #d6c39a;
}
/*
::-webkit-scrollbar-button:single-button:vertical:decrement {
border-width: 0 8px 8px 8px;
border-color: transparent transparent #000000 transparent;
}
::-webkit-scrollbar-button:single-button:vertical:decrement:hover {
border-color: transparent transparent #5e5e5e transparent;
}
::-webkit-scrollbar-button:single-button:vertical:increment {
border-width: 8px 8px 0 8px;
border-color: #000000 transparent transparent transparent;
}
::-webkit-scrollbar-button:vertical:single-button:increment:hover {
border-color: #5e5e5e transparent transparent transparent;
}
*/
html {
cursor: url(tasa-cursor-medium.cur), default;
}
a {
cursor: url(tasa-cursor-a-large.cur), default;
}
<header>
<nav>
<img src="logo.jpg" alt="TASA logo." class="nav-bar-image">
<ul>
<li>Home</li>
<li>Details</li>
<li class="dropdown">Presentations
<ul>
<li>Introduction</li>
<li>Constellations</li>
<li>Lunar Events</li>
</ul>
</li>
<li>Links</li>
</ul>
</nav>
</header>
<article class="left">
<h1>TASA</h1>
<p>
</p>
</article>
<article class=centre>
<h1>Images</h1>
</article>
This snippet has the display element on the articles set to block, not inline-block.
The problem: when you make the class left and centre inline-block, the margin-top of the nav is -130px. This makes it go out of screen.
A more clean solution would be to use flex box, and have some flexibility ;) of the alignment of items. In the solution, i removed the margin and changed it, see below:
/* Wrap the class "left" and "centre" with a div (i named it "main_content") */
.main_content {
display: flex;
flex-direction: row;
}
nav {
/* Removed this -> margin: -130px 0 0 -10px; */
position: fixed;
}
.centre {
/* Removed this --> margin-top: 0; */
}
nav>ul {
/* Changed margin-top from 20px to 0px */
margin-top: 0px;
}
#import url('https://fonts.googleapis.com/css2?family=Limelight&display=swap');
#import url('https://fonts.googleapis.com/css2?family=Zen+Dots&display=swap');
nav {
height: 120px;
background-color: black;
width: 100%;
display: block;
position: fixed;
}
.dropdown {
padding-right: 5px;
margin-right: 5px;
}
.tasa {
text-transform: uppercase;
font-family: 'Limelight', cursive;
}
.nav-bar-image {
width: 110px;
height: 100px;
margin: 10px -10px 10px 10px;
display: inline;
}
nav>ul>li>a {
text-decoration: none;
color: white;
}
nav>ul>li {
font-size: 20px;
font-family: Zen Dots;
display: inline;
padding: 10px;
}
nav>ul>li:hover {
background-color: darkgrey;
}
nav>ul>li>ul {
display: none;
margin-top: 10px;
font-size: 14px;
margin-left: 165px;
list-style-type: none;
position: absolute;
}
nav>ul>li:hover>ul {
display: block;
}
nav>ul>li>ul>li {
padding-left: 10px;
padding-right: 69.5px;
}
nav>ul>li>ul>li:hover {
background-color: darkgrey;
}
nav>ul>li>ul>li>a {
color: white;
text-decoration: none;
}
nav>ul {
display: inline-block;
vertical-align: top;
margin-top: 0px;
list-style-type: none;
}
body {
background-image: url(background.jpg);
}
article {
background-color: rgba(255, 231, 179, 0.80);
width: 400px;
margin: 130px 0 0 10px;
/*130px 0 0 10px*/
padding: 5px 10px 10px;
height: 200px;
text-align: justify;
height: 750px;
display: block;
vertical-align: top;
}
.main_content {
display: flex;
flex-direction: row;
}
.left {
border-top-left-radius: 50px;
border-bottom-left-radius: 50px;
height: 200px;
}
.centre {
height: 200px;
}
h1 {
color: white;
font-family: Limelight;
font-size: 40px;
text-align: center;
margin: 10px 0 0;
}
p {
text-align: jusify;
color: white;
}
article>ul>li>a {
color: white;
text-decoration: none;
}
article>ul {
list-style-type: none;
}
::-webkit-scrollbar {
width: 16px;
}
::-webkit-scrollbar-thumb {
background: #ffe7b3;
border-radius: 8px;
}
::-webkit-scrollbar-track {
background: #ffffff;
box-shadow: inset 0 0 5px grey;
border-radius: 8px;
}
/*
::-webkit-scrollbar-button:single-button {
background-color: #ffffff;
display: block;
border-style: solid;
height: 13px;
width: 16px;
}
*/
::-webkit-scrollbar-thumb:hover {
background: #d6c39a;
}
/*
::-webkit-scrollbar-button:single-button:vertical:decrement {
border-width: 0 8px 8px 8px;
border-color: transparent transparent #000000 transparent;
}
::-webkit-scrollbar-button:single-button:vertical:decrement:hover {
border-color: transparent transparent #5e5e5e transparent;
}
::-webkit-scrollbar-button:single-button:vertical:increment {
border-width: 8px 8px 0 8px;
border-color: #000000 transparent transparent transparent;
}
::-webkit-scrollbar-button:vertical:single-button:increment:hover {
border-color: #5e5e5e transparent transparent transparent;
}
*/
html {
cursor: url(tasa-cursor-medium.cur), default;
}
a {
cursor: url(tasa-cursor-a-large.cur), default;
}
<header>
<nav>
<img src="logo.jpg" alt="TASA logo." class="nav-bar-image">
<ul>
<li>Home</li>
<li>Details</li>
<li class="dropdown">Presentations
<ul>
<li>Introduction</li>
<li>Constellations</li>
<li>Lunar Events</li>
</ul>
</li>
<li>Links</li>
</ul>
</nav>
</header>
<div class="main_content">
<article class="left">
<h1>TASA</h1>
<p>
</p>
</article>
<article class="centre">
<h1>Images</h1>
</article>
</div>

How could I create this header effect but with an image behind it? HTML5

I'm looking to re-create this header but I want an image behind it instead of just a sold color, I want to use the black fade around but I can't find a way to get an image behind it.
background:#1a1a2e;
border-left:1px solid rgba(255, 255, 255, 0.1);
}
.sidebar-nav {
position: absolute;
top: 0;
width: 250px;
list-style: none;
margin: 0;
padding: 0;
}
.sidebar-nav li.sidebar-nav-item a {
display: block;
text-decoration: none;
color: #fff;
padding: 15px;
}
.sidebar-nav li a:hover {
text-decoration: none;
color: #fff;
background: rgba(255, 255, 255, 0.2);
}
.sidebar-nav li a:active,
.sidebar-nav li a:focus {
text-decoration: none;
}
.sidebar-nav>.sidebar-brand {
font-size: 1.2rem;
background: rgba(52, 58, 64, 0.1);
height: 80px;
line-height: 50px;
padding-top: 15px;
padding-bottom: 15px;
padding-left: 15px;
}
.sidebar-nav>.sidebar-brand a:hover {
color: #fff;
background: none;
}
#sidebar-wrapper.active {
right: 250px;
width: 250px;
transition: all .4s ease 0;
}
.masthead {
min-height: 30rem;
position: relative;
display: table;
width: 100%;
height: auto;
padding-top: 8rem;
padding-bottom: 8rem;
background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0 rgba(255, 255, 255, 0.1) 100%), url(https://www.nme.com/wp-content/uploads/2019/10/Black-Widow-Avengers.jpg);
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
box-shadow: inset 120px 100px 250px #000, inset -120px -100px 250px #000;
}
.masthead h1 {
text-transform: uppercase;
font-size: 4rem;
color: #fff;
margin: 0;
padding: 0;
}
.masthead .mb-5 em {
color: #fff;
text-transform: uppercase;
}
.btn-xl {
text-transform: uppercase;
background-color: #d35d6e;
border: none;
color: #fff;
padding: 1.25rem 2.5rem;
}
.btn-xl:hover {
background-color: #fd3a69;
color: #000;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: 700;
}
.Container {
margin: 2% 2% 0 3%;
}
.Movies img {
margin-right: 1%;
margin-bottom: 10%;
width: 100%;
border-radius: 10px;
cursor: pointer;
box-shadow: -4px 4px 5px 0 #000;
transition: .8s;
}
.Movies img:hover {
transform: translateY(-10px);
box-shadow: 0 19px 38px rgba(0, 0, 0, 0.3), 0 15px 12px rgba(0, 0, 0, 0.22);
}
.Container h2 {
margin-bottom: 2%;
color: #f3e6e3;
}
#footer {
background-color: #020314;
color: #fff;
text-align: center;
padding: 2% 15%;
}
.social-icon {
cursor: pointer;
margin: 20px 10px;
}
.social-icon:hover {
color: #5F9EA0;
}
.footername {
color: #FF7F50;
}
.footername:hover {
text-decoration: none;
color: #DC143C;
}
.scroll-to-top {
position: fixed;
right: 15px;
bottom: 15px;
width: 50px;
height: 50px;
text-align: center;
color: #fff;
background: rgba(52, 58, 64, 0.5);
line-height: 45px;
display: none;
}
.scroll-to-top:focus,
.scroll-to-top:hover {
color: #F5F5F5;
}
.scroll-to-top i {
font-weight: 800;
}
.menu-toggle:focus,
.menu-toggle:hover,
.sidebar-nav>.sidebar-brand a {
color: #fff;
}
.menu-toggle:hover,
.scroll-to-top:hover {
background: #343a40;
}
#media min-width 992px {
.masthead {
height: 100vh;
}
.masthead h1 {
font-size: 5.5rem;
}
}
<header class="masthead d-flex">
<div class="container text-center my-auto">
<h1 class="mb-1">Welcome</h1>
<h3 class="mb-5"><em>Join our discord Community</em></h3><a class="btn btn-primary btn-xl js-scroll-trigger" href="https://discord.gg/YmtGhGQPSu">Join Now</a>
</div>
<div class="overlay"></div>
</header>
try this
header {
background-image: url("")
}

Aligning div elements under each other

I am trying to align 3 divs under each other, I believe it is because of the vertical-align I used. I am trying to fix it up for the #media, when its at 480px to align the divs underneath. For some reason I am unable to accomplish this. I have spent about 3 hours trying to do this. Any help/suggestions is much appreciated.
Image:
HTML:
<div class="features">
<div id="features-title">
<p>Features fitted just for your website</p>
<hr>
</div>
<div class="features-body">
<div id="features-body-pages">
<div id="features-body-pages-title">
<p>Your Site</p>
</div>
<div id="features-body-pages-subtitle">
<p>User accessibility.</p>
</div>
<hr>
<div id="features-body-pages-main">
<p>From navigation to user accessibility, we make your website easy for your visitors to navigate around. You don't want your visitors leaving, and neither do we! That's why we make your site appealing.</p>
</div>
</div>
<div id="features-body-support">
<div id="features-body-support-title">
<p>24/7 Support</p>
</div>
<div id="features-body-support-subtitle">
<p>Never hesitate.</p>
</div>
<hr>
<div id="features-body-support-main">
<p>Unlike most places, we actually offer 24/7 support with minimum wait time. Even after your website has been delivered, it's not to late to ask for help. We are always here and glade to help.</p>
</div>
</div>
<div id="features-body-types">
<div id="features-body-types-title">
<p>Types of websites</p>
</div>
<div id="features-body-types-subtitle">
<p>Request any kind of site.</p>
</div>
<hr>
<div id="features-body-types-main">
<p>You name it, we make it! From small personal sites to large company sites. All you need to do is provide us with the website information, and we will do the rest.
</div>
</div>
</div>
</div>
CSS:
body {
margin: 0;
background-image: url("../images/CrystalDevLogo.png");
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
}
ul.topnav {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #4484CE;
}
ul.topnav li {float: left;}
ul.topnav li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
ul.topnav li a:hover:not(.active) {background-color: #3a88e3;}
ul.topnav li a.active {background-color: #D9D9D9;}
ul.topnav li.right {float: right;}
#media screen and (max-width: 600px){
ul.topnav li.right,
ul.topnav li {float: none;}
}
.cover-image {
width: 100%;
height: auto;
position: absolute;
z-index: -1;
}
.cover-image img {
width: 100%;
height: auto;
opacity: 0.5;
filter: alpha(opacity=50);
z-index: -1;
}
#alert-motd {
text-align: center;
overflow: hidden;
position: relative;
height: 50px;
}
#alert-motd p {
font-size: 18px;
position: absolute;
width: 100%;
height: 100%;
margin: 0;
text-align: center;
/* Starting position */
-moz-transform:translateX(100%);
-webkit-transform:translateX(100%);
transform:translateX(100%);
/* Apply animation to this element */
-moz-animation: scroll-left 25s linear infinite;
-webkit-animation: scroll-left 25s linear infinite;
animation: scroll-left 25s linear infinite;
}
/* Move it (define the animation) */
#-moz-keyframes scroll-left {
0% { -moz-transform: translateX(100%); }
100% { -moz-transform: translateX(-100%); }
}
#-webkit-keyframes scroll-left {
0% { -webkit-transform: translateX(100%); }
100% { -webkit-transform: translateX(-100%); }
}
#keyframes scroll-left {
0% {
-moz-transform: translateX(100%); /* Browser bug fix */
-webkit-transform: translateX(100%); /* Browser bug fix */
transform: translateX(100%);
}
100% {
-moz-transform: translateX(-100%); /* Browser bug fix */
-webkit-transform: translateX(-100%); /* Browser bug fix */
transform: translateX(-100%);
}
}
#media all and (max-width: 1690px) {
.body-quote {
float: left;
margin-left: 10px;
margin-top: 10px;
width: 280px;
height: auto;
background-image: linear-gradient(#17A3DC, #157DA8);
border-radius: 15px;
box-shadow:
0px 2px 2px 5px #555,
0px 4px 4px 5px #555,
0px 6px 6px 5px #555,
0px 8px 8px 5px #555;
}
.body-quote-title {
text-align: left;
font-size: 30px;
width: auto;
height: auto;
color: white;
padding: 0px 8px 0px 8px;
}
.body-quote-subtitle {
text-align: left;
font-size: 16px;
width: auto;
height: auto;
color: white;
padding: 0px 8px 0px 8px;
}
.body-quote-body {
height: auto;
width: auto;
text-align: center;
padding-bottom: 8px;
}
.body-quote-body #free-quote {
border-radius: 15px;
background-color: #24BF39;
}
.body-quote-body #schedule-appointment {
border-radius: 15px;
background-color: #24BF39;
}
.body-help {
float: right;
margin-right: 10px;
margin-top: 10px;
width: 280px;
height: auto;
background-image: linear-gradient(#17A3DC, #157DA8);
border-radius: 15px;
box-shadow:
0px 2px 2px 5px #555,
0px 4px 4px 5px #555,
0px 6px 6px 5px #555,
0px 8px 8px 5px #555;
}
.body-help-title {
text-align: left;
font-size: 30px;
width: auto;
height: auto;
color: white;
padding: 0px 8px 0px 8px;
}
.body-help-subtitle {
text-align: left;
font-size: 16px;
width: auto;
height: auto;
color: white;
padding: 0px 8px 0px 8px;
}
.body-help-body {
height: auto;
width: auto;
text-align: center;
padding: 0px 8px 0px 8px;
color: white;
}
.body-help-body p {
padding: 8px 8px 0px 8px;
}
.body-help-body #help-contact {
border-radius: 15px;
background-color: #24BF39;
}
.features {
margin: 0 auto;
width: 90%;
text-align: center;
background-color: rgba(193, 196, 195, .6);
margin-top: 500px;
border-radius: 15px;
}
.features-body {
display: flex;
flex-direction: row;
justify-content: space-between;
padding: 0px 15px 15px;
}
.features #features-title {
font-size: 50px;
font-style: bold;
background-color: rgba(75, 180, 44, .6);
border-radius: 15px;
color: black;
}
.features #features-body-pages {
background-color: #F65555;
border-radius: 5px;
width: 200px;
height: auto;
}
.features #features-body-pages-title {
background-color: rgb(77, 202, 40);
border-radius: 5px;
width: 200px;
height: auto;
color: white;
font-size: 26px;
display: table-cell;
vertical-align: middle;
}
.features #features-body-pages-subtitle {
width: auto;
height: auto;
font-size: 20px;
}
.features #features-body-pages hr {
border: none;
height: 2px;
color: #333;
background-color: #333;
width: 90%;
}
.features #features-body-support {
background-color: #F65555;
border-radius: 5px;
width: 200px;
height: auto;
}
.features #features-body-support-title {
background-color: rgb(77, 202, 40);
border-radius: 5px;
width: 200px;
height: auto;
color: white;
font-size: 26px;
display: table-cell;
vertical-align: middle;
}
.features #features-body-support-subtitle {
width: auto;
height: auto;
font-size: 20px;
}
.features #features-body-support hr {
border: none;
height: 2px;
color: #333;
background-color: #333;
width: 90%;
}
.features #features-body-support-main {
padding: 10px 10px 10px 10px;
}
.features #features-body-types {
background-color: #F65555;
border-radius: 5px;
width: 200px;
height: auto;
}
.features #features-body-types-title {
background-color: rgb(77, 202, 40);
border-radius: 5px;
width: 200px;
height: auto;
color: white;
font-size: 26px;
display: table-cell;
vertical-align: middle;
}
.features #features-body-types-subtitle {
width: auto;
height: auto;
font-size: 20px;
}
.features #features-body-types hr {
border: none;
height: 2px;
color: #333;
background-color: #333;
width: 90%;
}
.features #features-body-types-main {
padding: 10px 10px 10px 10px;
}
.contact {
background-color: rgba(193, 196, 195, .6);
border-radius: 15px;
text-align: center;
margin-top: 200px !important;
width: 90%;
margin: 0 auto;
}
.contact #contact-header {
border-radius: 10px;
background-color: rgba(80, 140, 205, .9);
width: 90%;
margin: 0 auto;
color: black;
}
.contact #contact-title {
font-size: 50px;
font-style: bold;
text-align: center;
}
.contact #contact-subtitle {
font-size: 22px;
font-style: bold;
}
.contact #contact-info-email {
font-size: 20px;
font-style: bold;
}
.contact #contact-info-phone {
font-size: 20px;
font-style: italic;
font-style: bold;
}
.contact-form {
width: 600px;
margin: 0 auto;
}
}
#media all and (max-width: 1280px) {
.body-quote {
float: left;
margin-left: 10px;
margin-top: 10px;
width: 280px;
height: auto;
background-image: linear-gradient(#17A3DC, #157DA8);
border-radius: 15px;
box-shadow:
0px 2px 2px 5px #555,
0px 4px 4px 5px #555,
0px 6px 6px 5px #555,
0px 8px 8px 5px #555;
}
.body-quote-title {
text-align: left;
font-size: 30px;
width: auto;
height: auto;
color: white;
padding: 0px 8px 0px 8px;
}
.body-quote-subtitle {
text-align: left;
font-size: 16px;
width: auto;
height: auto;
color: white;
padding: 0px 8px 0px 8px;
}
.body-quote-body {
height: auto;
width: auto;
text-align: center;
padding-bottom: 8px;
}
.body-quote-body #free-quote {
border-radius: 15px;
background-color: #24BF39;
}
.body-quote-body #schedule-appointment {
border-radius: 15px;
background-color: #24BF39;
}
.body-help {
float: right;
margin-right: 10px;
margin-top: 10px;
width: 280px;
height: auto;
background-image: linear-gradient(#17A3DC, #157DA8);
border-radius: 15px;
box-shadow:
0px 2px 2px 5px #555,
0px 4px 4px 5px #555,
0px 6px 6px 5px #555,
0px 8px 8px 5px #555;
}
.body-help-title {
text-align: left;
font-size: 30px;
width: auto;
height: auto;
color: white;
padding: 0px 8px 0px 8px;
}
.body-help-subtitle {
text-align: left;
font-size: 16px;
width: auto;
height: auto;
color: white;
padding: 0px 8px 0px 8px;
}
.body-help-body {
height: auto;
width: auto;
text-align: center;
padding: 0px 8px 0px 8px;
color: white;
}
.body-help-body p {
padding: 8px 8px 0px 8px;
}
.body-help-body #help-contact {
border-radius: 15px;
background-color: #24BF39;
}
.features {
margin: 0 auto;
width: 90%;
text-align: center;
background-color: rgba(193, 196, 195, .6);
margin-top: 500px;
border-radius: 15px;
}
.features-body {
display: flex;
flex-direction: row;
justify-content: space-between;
padding: 0px 15px 15px;
}
.features #features-title {
font-size: 50px;
font-style: bold;
background-color: rgba(75, 180, 44, .6);
border-radius: 15px;
color: black;
}
.features #features-body-pages {
background-color: #F65555;
border-radius: 5px;
width: 200px;
height: auto;
}
.features #features-body-pages-title {
background-color: rgb(77, 202, 40);
border-radius: 5px;
width: 200px;
height: auto;
color: white;
font-size: 26px;
display: table-cell;
vertical-align: middle;
}
.features #features-body-pages-subtitle {
width: auto;
height: auto;
font-size: 20px;
}
.features #features-body-pages hr {
border: none;
height: 2px;
color: #333;
background-color: #333;
width: 90%;
}
.features #features-body-support {
background-color: #F65555;
border-radius: 5px;
width: 200px;
height: auto;
}
.features #features-body-support-title {
background-color: rgb(77, 202, 40);
border-radius: 5px;
width: 200px;
height: auto;
color: white;
font-size: 26px;
display: table-cell;
vertical-align: middle;
}
.features #features-body-support-subtitle {
width: auto;
height: auto;
font-size: 20px;
}
.features #features-body-support hr {
border: none;
height: 2px;
color: #333;
background-color: #333;
width: 90%;
}
.features #features-body-support-main {
padding: 10px 10px 10px 10px;
}
.features #features-body-types {
background-color: #F65555;
border-radius: 5px;
width: 200px;
height: auto;
}
.features #features-body-types-title {
background-color: rgb(77, 202, 40);
border-radius: 5px;
width: 200px;
height: auto;
color: white;
font-size: 26px;
display: table-cell;
vertical-align: middle;
}
.features #features-body-types-subtitle {
width: auto;
height: auto;
font-size: 20px;
}
.features #features-body-types hr {
border: none;
height: 2px;
color: #333;
background-color: #333;
width: 90%;
}
.features #features-body-types-main {
padding: 10px 10px 10px 10px;
}
}
#media all and (max-width: 980px) {
}
#media all and (max-width: 736px) {
.body-quote, .body-help { float: none; margin:auto;}
.features #features-body-types, .features #features-body-support, .features #features-body-pages {
display: inline;
margin: auto;
}
}
#media all and (max-width: 480px) {
.body-quote {
margin: 0 auto;
width: 280px;
background-image: linear-gradient(#17A3DC, #157DA8);
border-radius: 15px;
box-shadow:
0px 2px 2px 5px #555,
0px 4px 4px 5px #555,
0px 6px 6px 5px #555,
0px 8px 8px 5px #555;
}
.body-quote-title {
text-align: left;
font-size: 30px;
width: auto;
height: auto;
color: white;
padding: 0px 8px 0px 8px;
}
.body-quote-subtitle {
text-align: left;
font-size: 16px;
width: auto;
height: auto;
color: white;
padding: 0px 8px 0px 8px;
}
.body-quote-body {
height: auto;
width: auto;
text-align: center;
padding-bottom: 8px;
}
.body-quote-body #free-quote {
border-radius: 15px;
background-color: #24BF39;
}
.body-quote-body #schedule-appointment {
border-radius: 15px;
background-color: #24BF39;
}
.body-help {
left: 0;
right: 0;
margin: 0 auto;
width: 280px;
height: auto;
background-image: linear-gradient(#17A3DC, #157DA8);
border-radius: 15px;
box-shadow:
0px 2px 2px 5px #555,
0px 4px 4px 5px #555,
0px 6px 6px 5px #555,
0px 8px 8px 5px #555;
}
.body-help-title {
text-align: left;
font-size: 30px;
width: auto;
height: auto;
color: white;
padding: 0px 8px 0px 8px;
}
.body-help-subtitle {
text-align: left;
font-size: 16px;
width: auto;
height: auto;
color: white;
padding: 0px 8px 0px 8px;
}
.body-help-body {
height: auto;
width: auto;
text-align: center;
padding: 0px 8px 0px 8px;
color: white;
}
.body-help-body p {
padding: 8px 8px 0px 8px;
}
.body-help-body #help-contact {
border-radius: 15px;
background-color: #24BF39;
}
.features {
text-align: center;
width: 90%;
text-align: center;
background-color: rgba(193, 196, 195, .6);
margin-top: 500px;
border-radius: 15px;
height: auto;
}
.features-body {
padding: 0px 15px 15px;
}
.features #features-title {
font-size: 50px;
font-style: bold;
background-color: rgba(75, 180, 44, .6);
border-radius: 15px;
color: black;
}
.features #features-body-pages {
background-color: #F65555;
border-radius: 5px;
width: auto;
height: auto;
float: left;
}
.features #features-body-pages-title {
background-color: rgb(77, 202, 40);
border-radius: 5px;
width: 200px;
height: auto;
color: white;
font-size: 26px;
}
.features #features-body-pages-subtitle {
width: auto;
height: auto;
font-size: 20px;
}
.features #features-body-pages hr {
border: none;
height: 2px;
color: #333;
background-color: #333;
width: 90%;
}
.features #features-body-pages-main {
padding: 10px 10px 10px 10px;
}
.features #features-body-support {
background-color: #F65555;
border-radius: 5px;
width: auto;
height: auto;
float: left;
}
.features #features-body-support-title {
background-color: rgb(77, 202, 40);
border-radius: 5px;
width: 200px;
height: auto;
color: white;
font-size: 26px;
}
.features #features-body-support-subtitle {
width: auto;
height: auto;
font-size: 20px;
}
.features #features-body-support hr {
border: none;
height: 2px;
color: #333;
background-color: #333;
width: 90%;
}
.features #features-body-support-main {
padding: 10px 10px 10px 10px;
}
.features #features-body-types {
background-color: #F65555;
border-radius: 5px;
width: auto;
height: auto;
float: left;
}
.features #features-body-types-title {
background-color: rgb(77, 202, 40);
border-radius: 5px;
width: 200px;
height: auto;
color: white;
font-size: 26px;
}
.features #features-body-types-subtitle {
width: auto;
height: auto;
font-size: 20px;
}
.features #features-body-types hr {
border: none;
height: 2px;
color: #333;
background-color: #333;
width: 90%;
}
.features #features-body-types-main {
padding: 10px 10px 10px 10px;
}
.contact {
background-color: rgba(193, 196, 195, .6);
border-radius: 15px;
text-align: center;
margin-top: 200px !important;
width: 90%;
margin: 0 auto;
}
.contact #contact-header {
border-radius: 10px;
background-color: rgba(80, 140, 205, .9);
width: 90%;
margin: 0 auto;
color: black;
}
.contact #contact-title {
font-size: 50px;
font-style: bold;
text-align: center;
}
.contact #contact-subtitle {
font-size: 22px;
font-style: bold;
}
.contact #contact-info-email {
font-size: 20px;
font-style: bold;
}
.contact #contact-info-phone {
font-size: 20px;
font-style: italic;
font-style: bold;
}
.contact-form {
width: auto;
margin: 0 auto;
}
}
Just set all of them are float: left and put them inside a container which has enough wide in order to fit them, so that the others will be pushed down.
div id="myDIV">
<div>content 1</div>
<div>content 2</div>
<div>content 3</div>
<div>content 4</div>
</div>
CSS:
#myDIV{
width: 800px;
}
#myDIV div {
float: left;
height: 400px;
width: 400px;
}

How to center the buttons and make them same size

I am new to CSS and trying to make a page. I have 2 radio buttons but I am trying to make them appear like regular buttons using css.
They look pretty similar but I am unable to center them and they are not the same size. How can I fix this.
* {
box-sizing: border-box;
background-color: #bf2e1a;
}
header {
color: #EFDFBC;
border-style: solid;
border-color: #EFDFBC;
top: 100px;
margin-left: 650px;
margin-right: 650px;
margin-top: 150px;
text-align: center;
font-size: 60px;
border-width: 5px;
}
div#get-justice {
position: relative;
top: 30px;
padding-top: 10px;
background-color: #EFDFBC;
margin: 0 auto;
width: 600px;
height: 600px;
}
div#get-justice p {
background-color: #EFDFBC;
color: red;
padding: 40px 40px 4px 40px;
font-size: 28px;
}
div#get-justice button {
background-color: red;
border: none;
color: white;
margin-top: 120px;
padding: 20px 37px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 21px;
cursor: pointer;
}
h3 {
background: #EFDFBC;
padding-top: 45px;
text-align: center;
color: red;
font-size: 23px;
}
/*div#first-question {
margin: 0px auto;
width: 650px;
height: 460px;
background: #EFDFBC;
}*/
ul {
columns: 2;
background: #EFDFBC;
}
li {
text-align: -webkit-match-parent;
background: #EFDFBC;
display: block;
padding: 1px 0px 3px 37px;
}
input#quiz-question-one-yes {
display: none;
margin: 11px;
}
input#quiz-question-one-no {
display: none;
margin: 11px;
}
label#oneYes {
display: inherit;
margin: 13px 360px 0px 195px;
padding: 8px 73px 8px 22px;
background-color: red;
border-color: #ddd;
font-size: 33px;
text-align: center;
}
label#oneNo {
display: inherit;
margin: -54px 296px 0px 300px;
padding: 12px 66px 5px 18px;
background-color: red;
border-color: #ddd;
font-size: 33px;
text-align: center;
}
input#quiz-question-two-yes {
display: none;
margin: 11px;
}
input#quiz-question-two-no {
display: none;
margin: 11px;
}
label#twoYes {
display: inherit;
margin: 13px 360px 0px 195px;
padding: 8px 73px 8px 22px;
background-color: red;
border-color: #ddd;
font-size: 33px;
text-align: center;
}
label#twoNo {
display: inherit;
margin: -54px 296px 0px 300px;
padding: 12px 66px 5px 18px;
background-color: red;
border-color: #ddd;
font-size: 33px;
text-align: center;
}
input#quiz-question-three-yes {
display: none;
margin: 11px;
}
input#quiz-question-three-no {
display: none;
margin: 11px;
}
label#threeYes {
display: inherit;
margin: 13px 360px 0px 195px;
padding: 8px 73px 8px 22px;
background-color: red;
border-color: #ddd;
font-size: 33px;
text-align: center;
}
label#threeNo {
display: inherit;
margin: -54px 296px 0px 300px;
padding: 12px 66px 5px 18px;
background-color: red;
border-color: #ddd;
font-size: 33px;
text-align: center;
}
input#quiz-question-four-yes {
display: none;
margin: 11px;
}
input#quiz-question-four-no {
display: none;
margin: 11px;
}
label#fourYes {
display: inherit;
margin: 13px 360px 0px 195px;
padding: 8px 73px 8px 22px;
background-color: red;
border-color: #ddd;
font-size: 33px;
text-align: center;
}
label#fourNo {
display: inherit;
margin: -54px 296px 0px 300px;
padding: 12px 66px 5px 18px;
background-color: red;
border-color: #ddd;
font-size: 33px;
text-align: center;
}
input#quiz-question-five-yes {
display: none;
margin: 11px;
}
input#quiz-question-five-no {
display: none;
margin: 11px;
}
label#fiveYes {
display: inherit;
margin: 13px 360px 0px 195px;
padding: 8px 73px 8px 22px;
background-color: red;
border-color: #ddd;
font-size: 33px;
text-align: center;
}
label#fiveNo {
display: inherit;
margin: -54px 296px 0px 300px;
padding: 12px 66px 5px 18px;
background-color: red;
border-color: #ddd;
font-size: 33px;
text-align: center;
}
.hidden {
display: none;
}
.visible {
display: block;
margin: 0 auto;
width: 650px;
height: 369px;
background: #EFDFBC;
}
.questions {
margin: 0px auto;
width: 650px;
height: 654px;
background: #EFDFBC;
}
.questions-header {
color: #EFDFBC;
border-style: solid;
border-color: #EFDFBC;
top: 100px;
padding-bottom: 30px;
padding-top: 30px;
margin-top: 150px;
text-align: center;
font-size: 60px;
border-width: 5px;
}
<!DOCTYPE html>
<html>
<head>
<meta charset = "UTF-8"/>
<title>Questions</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class = "quiz-questions">
<div id="first-question" class="visible questions">
<h1 class = "questions-header"> Question 1 </h1>
<h3>Do you see number 1 to 5</h3>
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
</ul>
<hr>
<input type="radio" id="quiz-question-one-yes" value="yes" />
<label for="quiz-question-one-yes" id="oneYes">Yes</label>
<input type="radio" id="quiz-question-one-no" value="no" />
<label for="quiz-question-one-no" id="oneNo">No</label>
</div>
</div>
</body>
</html>
I would wrap the label and the input in a separate div. So it would be something like this:
input#quiz-question-one-yes {
display: none;
margin: 11px;
}
input#quiz-question-one-no {
display: none;
margin: 11px;
}
label#oneYes, label#oneNo {
background-color: red;
text-align: center;
padding: 10px;
width: 80px;
display: block;
}
.button
{
display: inline-block;
}
<div class = "quiz-questions">
<div id="first-question" class="visible questions">
<div class="button">
<input type="radio" id="quiz-question-one-yes" value="yes" />
<label for="quiz-question-one-yes" id="oneYes">Yes</label>
</div>
<div class="button">
<input type="radio" id="quiz-question-one-no" value="no" />
<label for="quiz-question-one-no" id="oneNo">No</label>
</div>
</div>
</div>
This would also remove all the awkward padding and margins.
* {
box-sizing: border-box;
background-color: #bf2e1a;
}
header {
color: #EFDFBC;
border-style: solid;
border-color: #EFDFBC;
top: 100px;
margin-left: 650px;
margin-right: 650px;
margin-top: 150px;
text-align: center;
font-size: 60px;
border-width: 5px;
}
div#get-justice {
position: relative;
top: 30px;
padding-top: 10px;
background-color: #EFDFBC;
margin: 0 auto;
width: 600px;
height: 600px;
}
div#get-justice p {
background-color: #EFDFBC;
color: red;
padding: 40px 40px 4px 40px;
font-size: 28px;
}
div#get-justice button {
background-color: red;
border: none;
color: white;
margin-top: 120px;
padding: 20px 37px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 21px;
cursor: pointer;
}
h3 {
background: #EFDFBC;
padding-top: 45px;
text-align: center;
color: red;
font-size: 23px;
}
div#first-question {
text-align: center;
}
ul {
columns: 2;
background: #EFDFBC;
}
li {
text-align: -webkit-match-parent;
background: #EFDFBC;
display: block;
padding: 1px 0px 3px 37px;
}
input#quiz-question-one-yes {
display: none;
margin: 11px;
}
input#quiz-question-one-no {
display: none;
margin: 11px;
}
label#oneYes {
display: inline-block;
margin: 10px;
padding: 10px 30px;
background-color: red;
border-color: #ddd;
font-size: 33px;
text-align: center;
}
label#oneNo {
display: inline-block;
margin: 10px;
padding: 10px 30px;
background-color: red;
border-color: #ddd;
font-size: 33px;
text-align: center;
}
input#quiz-question-two-yes {
display: none;
margin: 11px;
}
input#quiz-question-two-no {
display: none;
margin: 11px;
}
label#twoYes {
display: inherit;
margin: 13px 360px 0px 195px;
padding: 8px 73px 8px 22px;
background-color: red;
border-color: #ddd;
font-size: 33px;
text-align: center;
}
label#twoNo {
display: inherit;
margin: -54px 296px 0px 300px;
padding: 12px 66px 5px 18px;
background-color: red;
border-color: #ddd;
font-size: 33px;
text-align: center;
}
input#quiz-question-three-yes {
display: none;
margin: 11px;
}
input#quiz-question-three-no {
display: none;
margin: 11px;
}
label#threeYes {
display: inherit;
margin: 13px 360px 0px 195px;
padding: 8px 73px 8px 22px;
background-color: red;
border-color: #ddd;
font-size: 33px;
text-align: center;
}
label#threeNo {
display: inherit;
margin: -54px 296px 0px 300px;
padding: 12px 66px 5px 18px;
background-color: red;
border-color: #ddd;
font-size: 33px;
text-align: center;
}
input#quiz-question-four-yes {
display: none;
margin: 11px;
}
input#quiz-question-four-no {
display: none;
margin: 11px;
}
label#fourYes {
display: inherit;
margin: 13px 360px 0px 195px;
padding: 8px 73px 8px 22px;
background-color: red;
border-color: #ddd;
font-size: 33px;
text-align: center;
}
label#fourNo {
display: inherit;
margin: -54px 296px 0px 300px;
padding: 12px 66px 5px 18px;
background-color: red;
border-color: #ddd;
font-size: 33px;
text-align: center;
}
input#quiz-question-five-yes {
display: none;
margin: 11px;
}
input#quiz-question-five-no {
display: none;
margin: 11px;
}
label#fiveYes {
display: inherit;
margin: 13px 360px 0px 195px;
padding: 8px 73px 8px 22px;
background-color: red;
border-color: #ddd;
font-size: 33px;
text-align: center;
}
label#fiveNo {
display: inherit;
margin: -54px 296px 0px 300px;
padding: 12px 66px 5px 18px;
background-color: red;
border-color: #ddd;
font-size: 33px;
text-align: center;
}
.hidden {
display: none;
}
.visible {
display: block;
margin: 0 auto;
width: 650px;
height: 369px;
background: #EFDFBC;
}
.questions {
margin: 0px auto;
width: 650px;
height: 654px;
background: #EFDFBC;
}
.questions-header {
color: #EFDFBC;
border-style: solid;
border-color: #EFDFBC;
top: 100px;
padding-bottom: 30px;
padding-top: 30px;
margin-top: 150px;
text-align: center;
font-size: 60px;
border-width: 5px;
}
<!DOCTYPE html>
<html>
<head>
<meta charset = "UTF-8"/>
<title>Questions</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class = "quiz-questions">
<div id="first-question" class="visible questions">
<h1 class = "questions-header"> Question 1 </h1>
<h3>Do you see number 1 to 5</h3>
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
</ul>
<hr>
<input type="radio" id="quiz-question-one-yes" value="yes" />
<label for="quiz-question-one-yes" id="oneYes">Yes</label>
<input type="radio" id="quiz-question-one-no" value="no" />
<label for="quiz-question-one-no" id="oneNo">No</label>
</div>
</div>
</body>
</html>
there are a few options for center:
one of the most easiest thing: you can use the html center tag:
<center> <input type="radio" id="quiz-question-one-no" value="no" /> </center>
you can use:
.input{
margin-left:50%;
margin-right:50%
}
There are maybe more options, but this are the easiest options.
for the same size, you need to set the min-width, min-height at same by the 2 buttons. Then the buttons will have the same minium size. For the text yes and no I think it will be work.