I want to move to the text area to align with other fields and then move all these fields to the down of the text "Feel free...." I was trying to use marigin-left, marigin-top, but nothing works. All the time these fields stay in one place. Do not know why.
It has to work on ip 6/7/8 plus resolution.
Could you tell me how can I achieve it?
* {
margin: 0;
padding: 0;
}
header {
width: 1920;
height: 1080px;
}
body {
display: flex;
flex-direction: column;
min-height: 100vh;
margin: 0;
height: 1080px;
background-image: linear-gradient(180deg, #EFEFEF00 0%, #0F4A37 100%);
}
footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: black;
color: white;
text-align: center;
}
footer img {
margin-top: 5px;
height: 30px;
display: inline-block;
padding: 0px 10px 0px 0px;
}
.main-nav {
float: right;
color: #000000;
margin-top: 40px;
margin-right: 0px;
}
.main-nav li {
display: inline-block;
}
.main-nav li a {
color: #000000;
text-decoration: none;
font: Bold 25px/15px Arial;
padding: 5px;
}
#logo {
margin-top: 10px;
float: left;
}
#tekst {
position: absolute;
}
#sign a {
background-color: #DCDFDE;
padding: 30px 15px 17px 15px;
border-top: 3px solid black;
border-bottom: 3px solid black;
border-left: 3px solid black;
border-right: 3px solid black;
}
#profilesign {
margin-top: 400px;
margin-left: 250px;
font: Bold 40px/40px Georgia;
letter-spacing: 0;
color: black;
}
.left {
-webkit-border-radius: 20px;
-khtml-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 150px 150px;
}
img.left {
padding: 0px 40px 20px 40px;
width: 250px;
height: 250px;
margin-left: 400px;
margin-top: 500px;
}
article input {
width: 300px;
height: 40px;
background: white;
border-radius: 4px;
text-decoration: none;
text-align: center;
font: Bold 25px/12px Arial;
border-radius: 120;
border-style: none;
padding: 6px;
margin-left: 1000px;
margin-top: 500px;
}
article #textSign {
font-size: 50px;
color: black;
text-align: center;
}
#centerText {
text-align: center;
}
#something {
width: 700px;
height: 300px;
text-align: justify;
margin-left: 1000px;
font-size: 30px;
font-weight: bold;
}
#media only screen and (max-device-width: 500px) {
#profilesign {
width: 1000px;
margin-top: 750px;
margin-left: 400px;
font: Bold 60px/40px Georgia;
letter-spacing: 0;
color: black;
}
img.left {
padding: 0px 40px 20px 40px;
width: 550px;
height: 550px;
margin-left: 550px;
margin-top: 450px;
}
footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: 60px;
background-color: black;
color: white;
text-align: center;
}
footer img {
margin-top: 5px;
height: 50px;
display: inline-block;
padding: 0px 10px 0px 0px;
}
#sign a {
background-color: #DCDFDE;
padding: 20px 15px 17px 1px;
border-top: 3px solid black;
border-bottom: 3px solid black;
border-left: 3px solid black;
border-right: 3px solid black;
}
#logo img {
margin-left: 550px;
text-align: center;
width: 650px;
}
body {
background-image: linear-gradient(180deg, #EFEFEF00 0%, #0F4A37 100%);
background-size: 100% 3000px;
width: auto;
}
.row {
width: 2500px;
display: grid;
grid-template-columns: 0% 80%;
}
.main-nav {
margin-left: 100px;
margin-top: 250px;
float: left;
display: inline-flex;
list-style: none;
}
.main-nav li a {
border-right: 3px solid black;
color: #000000;
text-decoration: none;
font: Bold 58px/45px Arial;
}
#something {
width: 700px;
height: 300px;
text-align: justify;
margin-top: 200px;
font-size: 30px;
font-weight: bold;
}
article input {
width: 400px;
height: 70px;
background: white;
border-radius: 4px;
text-decoration: none;
text-align: center;
font: Bold 45px/12px Arial;
border-radius: 120;
border-style: none;
padding: 6px;
margin-left: 700px;
}
}
<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<title>DingDog</title>
<link rel="stylesheet" href="css-images/style-contact.css">
</head>
<body>
<header>
<div class="row">
<ul id="logo"> <img src="css-images/dingdog-logo.png"> </ul>
<ul class="main-nav">
<li style="padding-left:10px">PROFILE</li>
<li style="padding-left:10px">MAP</li>
<li style="padding-left:10px">YOUR FRIENDS</li>
<li style="padding-left:10px">MAILBOX</li>
<li style="padding-left:10px" id="sign">LOG OUT</li>
</ul>
</div>
<section>
<article>
<p id="profilesign">Feel free to send us a question.</p>
<img class="left" src="css-images/mial.jpg" style='position:absolute;left:0px; top:0px;' />
<div id="lala">
<p id="centerText">
<label><input type="email" name="email" placeholder="Email" style='margin-top:250px;position:absolute;left:0px; top:0px;' ></label><br/>
<label><input type="name" name="name" placeholder="Name" style="margin-top: 350px; position:absolute;left:0px; top:0px;"></label><br>
<label><input type="subject" name="subject" placeholder='Subject:' style="margin-top: 450px; position:absolute;left:0px; top:0px;"></label><br></p>
<textarea placeholder='Type something' id="something" style="margin-top: 550px; position:absolute;left:0px; top:0px;"></textarea>
</div>
<label id="submit"><input type="submit" name="send" value="Send" style="margin-top: 900px;position:absolute;left:0px; top:0px; background: #2699FB 0% 0% no-repeat padding-box;"></label>
</article>
</section>
</header>
<footer>
<img src="social/instagram.png" />
<img src="social/twitter-white-logo.png" />
<img src="social/facebook.png" />
</footer>
</body>
</html>
So i have been struggling a bit with a problem of mine. First my Nav bar will for the life of me not go Into the header element. my picture element (#Billede div box) seems to be affected by this since i've only given it a height and width, but it scaled all the way to the left and is there to stay.
Any tips?
nav,
li,
a {
text-decoration: none;
list-style-type: none;
float: right;
margin-bottom: 10px;
padding: 5px;
}
header {
width: 80%;
height: 100px;
margin-rigth: 10%;
margin-left: 10%;
color: rgb(255, 46, 248);
}
form {
margin-top: 100px;
width: 800px;
margin-right: 400px;
}
input[type=text],
select {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
margin-bottom: 15px;
}
textarea[type=text],
select {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
float: left;
resize: none;
}
button[type=submit] {
width: 100%;
background-color: rgb(255, 45, 248);
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
border-radius: 4px;
cursor: pointer;
}
#Billede {
height: 60px;
width: 30px;
}
<header>
<h1>Mike's Portfolio</h1>
<nav>
<li>Opgaver</li>
<li>Om Mig</li>
</nav>
</header>
<div id="Info"></div>
<div id="Billede"><img src="../../Images/Billede.jpg"></div>
is this how you want this??.. h1 is a blog element so it it takes full width that is why nav comes on the next line. hope it helps
your image moved to right because your image is wrapped with a and a has float: right css
nav, li, a {
text-decoration: none;
list-style-type: none;
float: right; //this
margin-bottom: 10px;
padding: 5px;
}
nav, li, a{
text-decoration: none;
list-style-type: none;
float: right;
margin-bottom: 10px;
padding: 5px;
}
header{
width: 80%;
height: 100px;
margin-rigth: 10%;
margin-left: 10%;
color: rgb(255, 46, 248);
}
form{
margin-top: 100px;
width: 800px;
margin-right: 400px;
}
input[type=text], select {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
margin-bottom: 15px;
}
textarea[type=text], select{
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
float: left;
resize: none;
}
button[type=submit] {
width: 100%;
background-color: rgb(255, 45, 248);
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
border-radius: 4px;
cursor: pointer;
}
#Billede{
height: 60px;
width: 30px;
}
h1{
display: inline-block;
margin: 0;
}
<header>
<h1>Mike's Portfolio</h1>
<nav>
<li><a href="#">Opgaver</li>
<li><a href="index.html">Om Mig</li>
</nav>
</header>
<div id="Info"></div>
<div id="Billede"><img src="../../Images/Billede.jpg"</div>
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;
}
I would like to put my text on the right side of the darker box. I want the AAAAAAAAAAAAAA' above the dark box to be on the right side. I tried it by writing it in an another container but it pushes the dark box down. Thank you!
html {
height: 100%;
}
body {
min-height: 100%;
margin: 0;
padding: 0;
}
.gray-container {
background: #E5E5E5;
width: 60%;
margin: 0 auto;
min-height: 600px;
margin-top: 20px;
border-left: 10px
}
.dark-container {
background: #B9B9B9;
width: 20%;
margin: 0 auto;
min-height: 660px;
margin-top: 20px;
margin-bottom: 20px;
margin-left: 20px;
padding-left: 30px;
}
.text {
text-align: justify margin: 20px 20px 30px 100px;
}
img {
width: 300px;
height: 90px;
padding: 30px 30px 30px 50px;
}
.gray-banner {
float: left;
width: 60%;
min-height: 20px;
padding: 10px 0 0 10px;
background-color: #E5E5E5;
position: relative;
margin-top: 20px;
}
ul {
list-style-type: none;
margin: 0 120px 0 0;
padding: 0;
overflow: hidden;
border: 1px solid #e7e7e7;
background-color: #fff;
}
li {
float: left;
border-right: 1px solid #bbb;
border-color: #87CEFA;
width: 200px;
}
li:last-child {
border-right: none;
}
li a {
display: block;
color: #666;
text-align: center;
padding: 14px 5px;
text-decoration: none;
}
li a:hover:not(.active) {
background-color: #ddd;
}
li a.active {
color: white;
background-color: #4CAF51;
}
.container {
width: 100%;
display: flex;
justify-content: space-around;
align-items: center;
flex-wrap: wrap;
padding: 0 14px 15px 15px;
}
h1 {
margin: 5px 5px 15px 44px;
font-family: calibri;
}
h2 {
margin: 50px 27px 0 45px;
font-family: calibri;
}
p {
margin: 50px 27px 0 45px;
font-family: calibri;
font-size: 20px
}
<div class="container">
<img src="https://img.clipartfest.com/c61469b195ccf8a2f1090f2673258543_-of-the-nintendo-logo-nintendo-logo-clipart_1024-239.gif" />
<ul>
<li>a</li>
<li>b</li>
<li>c</li>
<li>d</li>
<li>e</li>
</ul>
<div class="gray-banner">
<h1>eeeeeeee</h1>
</div>
<div class="gray-container">
<div class="text">
<p>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</p>
</div>
<div class="dark-container">
<h2 style="font-size: 24px; margin: 10px 5px 5px 0; "><br>hey</h2>
</div>
You can use flex on the parent to put them in a row, then use order: -1 on the darker box to put it visually on the left of the text.
html {
height: 100%;
}
body {
min-height: 100%;
margin: 0;
padding: 0;
}
.gray-container {
background: #E5E5E5;
width: 60%;
margin: 0 auto;
min-height: 600px;
margin-top: 20px;
border-left: 10px;
display: flex;
}
.dark-container {
background: #B9B9B9;
width: 20%;
margin: 0 auto;
min-height: 660px;
margin-top: 20px;
margin-bottom: 20px;
margin-left: 20px;
padding-left: 30px;
order: -1;
}
.text {
text-align: justify margin: 20px 20px 30px 100px;
}
img {
width: 300px;
height: 90px;
padding: 30px 30px 30px 50px;
}
.gray-banner {
float: left;
width: 60%;
min-height: 20px;
padding: 10px 0 0 10px;
background-color: #E5E5E5;
position: relative;
margin-top: 20px;
}
ul {
list-style-type: none;
margin: 0 120px 0 0;
padding: 0;
overflow: hidden;
border: 1px solid #e7e7e7;
background-color: #fff;
}
li {
float: left;
border-right: 1px solid #bbb;
border-color: #87CEFA;
width: 200px;
}
li:last-child {
border-right: none;
}
li a {
display: block;
color: #666;
text-align: center;
padding: 14px 5px;
text-decoration: none;
}
li a:hover:not(.active) {
background-color: #ddd;
}
li a.active {
color: white;
background-color: #4CAF51;
}
.container {
width: 100%;
display: flex;
justify-content: space-around;
align-items: center;
flex-wrap: wrap;
padding: 0 14px 15px 15px;
}
h1 {
margin: 5px 5px 15px 44px;
font-family: calibri;
}
h2 {
margin: 50px 27px 0 45px;
font-family: calibri;
}
p {
margin: 50px 27px 0 45px;
font-family: calibri;
font-size: 20px
}
<div class="container">
<img src="https://img.clipartfest.com/c61469b195ccf8a2f1090f2673258543_-of-the-nintendo-logo-nintendo-logo-clipart_1024-239.gif" />
<ul>
<li>a</li>
<li>b</li>
<li>c</li>
<li>d</li>
<li>e</li>
</ul>
<div class="gray-banner">
<h1>eeeeeeee</h1>
</div>
<div class="gray-container">
<div class="text">
<p>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</p>
</div>
<div class="dark-container">
<h2 style="font-size: 24px; margin: 10px 5px 5px 0; "><br>hey</h2>
</div>
You should put float:right in your p element
p {
margin: 50px 27px 0 45px;
font-family: calibri;
font-size: 20px;
/*add this*/
float:right;
}
I have this login form, which works and looks just fine in Chrome, IE11 and Edge but when try it out on Firefox, it looks completely different;
My labels are not the same width, so I have to re-adjust them. Also, my submit button doesn't seem to take on styles.
How can I make this work with Firefox as well?
My HTML:
<div class="loginheader">تسجيل الدخول</div>
<div class="loginform">
<form action="login.php" method="post" name="myform" id="myform">
<p>
<label for="loginform">اسم المستخدم</label>
<input type="text" name="username" id="login" value="mohammed.nasyia#gmail.com" placeholder="اسم المستخدم" />
</p>
<p>
<label for="loginform">كلمة المرور</label>
<input type="password" name="password" id="password" value="mohammed.nasyia#gmail.com" placeholder="كلمة المرور" />
</p>
<p >
<input type="submit" name="submit" value="تسجيل الدخول" class="button admin-login-button"/>
</p>
</form>
</div>
<div class="loginfooter">
تسجيل الدخول كممتحن
</div>
</div>
CSS:
.login-container {
margin-top: 100px;
margin-bottom: 50px;
margin-left: auto;
margin-right: auto;
width: 600px;
}
.loginform {
direction:RTL;
padding: 55px;
background-color: #fff;
border: 1px solid #eee;
border-bottom: 0px;
border-top: 0px;
}
.loginheader {
text-align: center;
background-color: #f5f5f5;
padding: 15px 0px;
border-radius: 10px 10px 0 0;
font-size: 30px;
}
.loginfooter {
padding: 15px 40px;
background-color: #f5f5f5;
border-radius: 0px 0px 10px 10px;
font-size: 18px;
text-align: center;
}
.loginheader, .loginfooter {
background-color: #f5f5f5;
border: 1px solid #ededed;
}
a {
text-decoration: none;
color: #000;
}
input[type=text], input[type=password] {
padding: 0 10px;
width: 320px;
height: 38px;
font-size: 16px;
color: #555;
background-color: #fff;
background-image: none;
border: 1px solid #ccc;
border-radius: 4px;
}
label {
float: rihgt;
width: 100px;
line-height: 40px;
padding-left: 10px;
font-size: 18px;
text-align: left;
display: inline-block;
margin: 10px 0px;
}
.edit-examinee label{
float: rihgt;
width: 130px;
line-height: 40px;
padding-left: 10px;
font-size: 18px;
text-align: left;
display: inline-block;
margin: 10px 0px;
}
.loginform label {
float: rihgt;
width: 100px;
line-height: 40px;
padding-left: 10px;
font-size: 18px;
text-align: left;
display: inline-block;
margin: 10px 0px;
}
.button {
display: inline-block;
zoom: 1;
padding: 12px 30px;
margin: 0;
cursor: pointer;
border: 1px solid #bbb;
overflow: visible;
font: bold 16px arial, helvetica, sans-serif;
text-decoration: none;
white-space: nowrap;
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
}
.admin-login-button {
margin-right: 350px;
color: #333;
background-color: #fff;
border-color: #ccc;
}
.admin-login-button:hover {
color: #333;
background-color: #e6e6e6;
border-color: #adadad;
}
.admin-login-button:active {
color: #333;
background-color: #e6e6e6;
border-color: #adadad;
position: relative;
top: 2px;
text-shadow: none;
box-shadow: 0 1px 1px rgba(0, 0, 0, .3) inset;
}
You can also check the JSFiddle of the form.
I removed the floats (with a typo), set the margin to left on the .admin-login-button. I also added a media query for smaller screens.
https://jsfiddle.net/6p4v9hs6/7/
New CSS here:
.login-container {
margin-top: 100px;
margin-bottom: 50px;
margin-left: auto;
margin-right: auto;
width: 600px;
}
.loginform {
direction:RTL;
padding: 55px;
background-color: #fff;
border: 1px solid #eee;
border-bottom: 0px;
border-top: 0px;
}
.loginheader {
text-align: center;
background-color: #f5f5f5;
padding: 15px 0px;
border-radius: 10px 10px 0 0;
font-size: 30px;
}
.loginfooter {
padding: 15px 40px;
background-color: #f5f5f5;
border-radius: 0px 0px 10px 10px;
font-size: 18px;
text-align: center;
}
.loginheader, .loginfooter {
background-color: #f5f5f5;
border: 1px solid #ededed;
}
a {
text-decoration: none;
color: #000;
}
input[type=text], input[type=password] {
padding: 0 10px;
width: 320px;
height: 38px;
font-size: 16px;
color: #555;
background-color: #fff;
background-image: none;
border: 1px solid #ccc;
border-radius: 4px;
}
label {
/* float: rihgt; */
width: 100px;
line-height: 40px;
padding-left: 10px;
font-size: 18px;
text-align: left;
display: inline-block;
margin: 10px 0px;
}
.edit-examinee label{
/* float: rihgt; */
width: 130px;
line-height: 40px;
padding-left: 10px;
font-size: 18px;
text-align: left;
display: inline-block;
margin: 10px 0px;
}
.loginform label {
/* float: rihgt; */
width: 100px;
line-height: 40px;
padding-left: 10px;
font-size: 18px;
text-align: left;
display: inline-block;
margin: 10px 0px;
}
.button {
display: inline-block;
zoom: 1;
padding: 12px 30px;
margin: 0;
cursor: pointer;
border: 1px solid #bbb;
overflow: visible;
font: bold 16px arial, helvetica, sans-serif;
text-decoration: none;
white-space: nowrap;
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
}
.admin-login-button {
margin-left: 350px;
color: #333;
background-color: #fff;
border-color: #ccc;
}
.admin-login-button:hover {
color: #333;
background-color: #e6e6e6;
border-color: #adadad;
}
.admin-login-button:active {
color: #333;
background-color: #e6e6e6;
border-color: #adadad;
position: relative;
top: 2px;
text-shadow: none;
box-shadow: 0 1px 1px rgba(0, 0, 0, .3) inset;
}
#media screen and (max-width: 540px) {
input[type=text], input[type=password] {
width: 90%;
}
}
Seems to work in both Safari and Firefox.