How to make span the same size as its children? - html

I'm trying to place the logo and the form on the same line but can't because the span that containing the logo is spanning the whole line. How do I make it the same size as its content?
header {
text-align: right;
background-color: #333333;
border-bottom-width: 1px;
}
.clear {
display: inline;
margin-left: 5px;
}
.LogoHeader {
height: 25%;
width: 25%;
border-spacing: 20px;
vertical-align: middle;
margin-left: 47px;
}
.SearchForm {
display: inline;
padding: 10px 0px;
}
.SearchField {
display: inline;
border: none;
margin: 0;
line-height: 20px;
object-position: right;
margin: 0px 10px white;
}
.SearchButton {
display: inline;
background-color: deeppink;
border-style: none;
line-height: 20px;
}
<header>
<span style="position:relative;float: right; clear: right; width: 100%;"><img class="LogoHeader" src="C:\Users\David\Desktop\WebDevelopmentTest\images\NotWalla\logo.svg" alt="My news website"></span>
<div style="position: relative; vertical-align: middle; right: 50%; display: inline-block; height: -50%">
<form class="SearchForm">
<input class="SearchButton" type="submit" value="Search"><input class="SearchField" type="text" name="q" value autocomplete="off">
</form>
</div>
</header>

You can remove the width: 100%; from span styles.

Well... After some messing around I was able to figure it out!
You can't really see it in the code below but it definitely works.
Thank you all for the help.
header {
text-align: right;
background-color: #333333;
border-bottom-width: 1px;
}
.clear {
display: inline;
min-height: 28px;
}
.LogoHeader {
width: 100%;
height: 100%
}
.SearchForm {
display: inline;
padding: 10px 0px;
margin-right: 10px;
}
.SearchField {
border: none;
line-height: 30px;
margin: 0px 10px white;
direction: rtl;
}
.SearchButton {
background-color: deeppink;
border-style: none;
line-height: 30px;
<header style=" border-bottom: 20px solid #333; border-top: 20px solid #333;">
<div style=" width: 100%; float: right; clear: both; max-width: 303px; margin-right: 10px; transform: translateY(-6px)">
<img class="LogoHeader" src="C:\Users\David\Desktop\WebDevelopmentTest\images\NotWalla\logo.svg" alt="My news website">
</div>
<form class="SearchForm">
<input class="SearchButton" type="submit" value="Search"><input class="SearchField" type="text" name="q" value autocomplete="off">
</form>
</header>

Related

how to align a text beside form at CSS and HTML

I have a problem: I want to align an interactive text which is already in the left of a slider. So, I just want to align a login form in the right of that interactive text.
I have inform all the codes as well as an image of the output right now and the image inside the slider:
The image inside the slider:
The output of the code right now:
Desired outcome:
This is the CSS + HTML code of the text :
<div class="container-wrap">
<aside id="fh5co-hero">
<div class="flexslider">
<ul class="slides">
<li style="background-image: url(images/graduation1.png);">
<div class="overlay-gradient"></div>
<div class="container-fluid">
<div class="row">
<div class="col-md-6 col-md-offset-3 col-md-pull-3 slider-text">
<div class="wrapper">
<div class="typing-demo">
Hello!
<br> Welcome to the website- </br>
</div>
</div>
<style>
.wrapper {
height: 50vh;
/*This part is important for centering*/
display: flex;
align-items: center;
justify-content: center;
}
.typing-demo {
width: 22ch;
animation: typing 2s steps(22), blink .5s step-end infinite alternate;
white-space: nowrap;
overflow: hidden;
border-right: 2px solid;
font-family: monospace;
font-size: 2.3em;
color: #FFFFFF
}
#keyframes typing {
from {
width: 0
}
}
#keyframes blink {
50% {
border-color: transparent
}
}
</style>
**this is the CSS + HTML code of the form :**
<html>
<div class="container"></div>
<div class="form">
<div class="thumbnail"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/169963/hat.svg"/></div>
<form class="register-form">
<input type="text" placeholder="name"/>
<input type="password" placeholder="password"/>
<input type="text" placeholder="email address"/>
<button>create</button>
<p class="message">Already registered? Sign In</p>
</form>
<form class="login-form">
<input type="text" placeholder="Email"/>
<input type="password" placeholder="Password"/>
<button>login</button>
<p class="message">Are you a Business/Society? Register here</p>
</form>
</div>
</html>
<style>
.form {
position: relative;
z-index: 1;
background: #FFFFFF;
max-width: 300px;
margin: right;
padding: 60px;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
text-align: center;
}
.form .thumbnail {
background: #ffd700;
width: 150px;
height: 150px;
margin: 0 auto 30px;
padding: 50px 30px;
border-top-left-radius: 100%;
border-top-right-radius: 100%;
border-bottom-left-radius: 100%;
border-bottom-right-radius: 100%;
box-sizing: border-box;
}
.form .thumbnail img {
display: block;
width: 100%;
}
.form input {
outline: 0;
background: #f2f2f2;
width: 100%;
border: 0;
margin: 0 0 15px;
padding: 15px;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
box-sizing: border-box;
font-size: 14px;
}
.form button {
outline: 0;
background: #ffd700;
width: 100%;
border: 0;
padding: 15px;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
color: #FFFFFF;
font-size: 14px;
transition: all 0.3 ease;
cursor: pointer;
}
.form .message {
margin: 15px 0 0;
color: #b3b3b3;
font-size: 12px;
}
.form .message a {
color: #ffd700;
text-decoration: none;
}
.form .register-form {
display: none;
}
.container {
position: relative;
z-index: 1;
max-width: 300px;
margin: 0 auto;
}
.container:before, .container:after {
content: "";
display: block;
clear: both;
}
.container .info {
margin: 50px auto;
text-align: center;
}
.container .info h1 {
margin: 0 0 15px;
padding: 0;
font-size: 36px;
font-weight: 300;
color: #1a1a1a;
}
.container .info span {
color: #4d4d4d;
font-size: 12px;
}
.container .info span a {
color: #000000;
text-decoration: none;
}
.container .info span .fa {
color: #ffd700;
}
/* END Form */
</style>
I think I found a solution to your problem. The main thing you where missing is display: inline-block; This allows DIVs to be next to each other.
.flexslider {
display: inline-block;
width: 100%;
}
.row {
float: left;
}
.container {
float: right;
}

How to align center the box div responsively?

This is my html file
body {
background-color: rgb(231, 59, 59);
font-family: "Alata";
font-size: 20px;
margin: 30px;
}
h1 {
margin-top: 100px;
color: #202124;
text-align: center;
}
.box {
width: 1000px;
}
input {
position: relative;
display: inline-block;
box-sizing: border-box;
}
input[type="text"] {
background: #fff;
width: 600px;
height: 50px;
padding: 0 10px;
border: none;
outline: none;
border-radius: 25px 0 0 25px;
font-size: 15px;
}
button {
left: -5px;
position: relative;
border-radius: 0 25px 25px 0;
width: 110px;
height: 50px;
border: none;
outline: none;
cursor: pointer;
background: #ffc170;
color: #fff;
font-size: 21px;
}
<h1>This is my page title...</h1>
<div class="box">
<form>
<input type="text" name="" placeholder="Search here" />
<button type="button">Search</button>
</form>
</div>
My question is how can I align the box div align center(horizontally) responsively(dynamically) and how to make this webpage responsive when I checked this page's responsiveness it's not showing responsiveness.
Try this code:
body {
background-color: rgb(231, 59, 59);
font-family: "Alata";
font-size: 20px;
margin: 30px;
}
h1 {
margin-top: 100px;
color: #202124;
text-align: center;
}
.box {
max-width: 1000px;
width:100%;
margin:0 auto;
}
input {
position: relative;
display: inline-block;
box-sizing: border-box;
}
input[type="text"] {
background: #fff;
width: 600px;
height: 50px;
padding: 0 10px;
border: none;
outline: none;
border-radius: 25px 0 0 25px;
font-size: 15px;
}
button {
left: -5px;
position: relative;
border-radius: 0 25px 25px 0;
width: 110px;
height: 50px;
border: none;
outline: none;
cursor: pointer;
background: #ffc170;
color: #fff;
font-size: 21px;
}
<h1>This is my page title...</h1>
<div class="box">
<form>
<input type="text" name="" placeholder="Search here" />
<button type="button">Search</button>
</form>
</div>
What I have done is that I have changed the
.box {
width: 1000px;
}
to
.box {
max-width: 1000px;
width:100%;
margin:0 auto;
}
You can also use display: flexbox; and justify-content: center; in the div box to get almost the same result
Here is the code that I think will work if you want to use flexbox:
body {
background-color: rgb(231, 59, 59);
font-family: "Alata";
font-size: 20px;
margin: 30px;
}
h1 {
margin-top: 100px;
color: #202124;
text-align: center;
}
.box {
display: flexbox;
justify-content: center;
}
input {
position: relative;
display: inline-block;
box-sizing: border-box;
}
input[type="text"] {
background: #fff;
width: 600px;
height: 50px;
padding: 0 10px;
border: none;
outline: none;
border-radius: 25px 0 0 25px;
font-size: 15px;
}
<h1>This is my page title...</h1>
<div class="box">
<form>
<input type="text" name="" placeholder="Search here" />
<button type="button">Search</button>
</form>
</div>
NOTE I have used max-widht: 1000px; in my first method, you can change that as per need.
Change this
.box{
max-width: 1000px;
width:100%;
margin:0 auto;
}
use this but the condition is your parent div has 100% width(window width).
or another way to use flex
form{
width: 200px;
margin: auto;
}
<body>
<h1>This is my page title...</h1>
<div class="box">
<form>
<input type="text" name="" placeholder="Search here">
<button type="button">Search</button>
</form>
</div>
</body>
You can follow the below code. I try to give some explanation where I changed and why I did it
body {
background-color: rgb(231, 59, 59);
font-family: "Alata";
font-size: 20px;
margin: 0px;
}
h1 {
margin-top: 100px;
color: #202124;
text-align: center;
}
.box {
/*if you want to take result as a responsive then you need to add width as % not fixt size */
width: 100%;
text-align: center;
margin: 0 auto;
}
/*This div for form responsive */
.search-form{
width: 90%;
text-align: center;
margin: 0 auto;
}
input {
position: relative;
display: inline-block;
box-sizing: border-box;
}
input[type="text"] {
background: #fff;
width: 70%; /* I change here for px to % base one your requerment */
height: 50px;
padding: 0 10px;
border: none;
outline: none;
border-radius: 25px 0 0 25px;
font-size: 15px;
float: left; /* I change here for div assign as a left */
}
button {
position: relative;
border-radius: 0 25px 25px 0;
width: 30%; /* I change here for px to % base one your requerment */
height: 50px;
border: none;
outline: none;
cursor: pointer;
background: #ffc170;
color: #fff;
font-size: 21px;
float: left; /* I change here for div assign as a left */
}
<h1>This is my page title...</h1>
<div class="box">
<div class="search-form">
<form>
<input type="text" name="" placeholder="Search here" />
<button type="button">Search</button>
</form>
</div>
</div>
display: block fix needs these two blocks to be inserted in the css
.box {
max-width: 1000px;
margin: 0 auto;
}
form {
width: max-content;
margin: 0 auto;
}
Working Fiddle
body {
background-color: rgb(231, 59, 59);
font-family: "Alata";
font-size: 20px;
margin: 30px;
}
h1 {
margin-top: 100px;
color: #202124;
text-align: center;
}
.box {
max-width: 1000px;
margin: 0 auto;
}
form {
width: max-content;
margin: 0 auto;
}
input {
position: relative;
display: inline-block;
box-sizing: border-box;
}
input[type="text"] {
background: #fff;
width: 600px;
height: 50px;
padding: 0 10px;
border: none;
outline: none;
border-radius: 25px 0 0 25px;
font-size: 15px;
}
button {
left: -5px;
position: relative;
border-radius: 0 25px 25px 0;
width: 110px;
height: 50px;
border: none;
outline: none;
cursor: pointer;
background: #ffc170;
color: #fff;
font-size: 21px;
}
<h1>This is my page title...</h1>
<div class="box">
<form>
<input type="text" name="" placeholder="Search here" />
<button type="button">Search</button>
</form>
</div>
If you are good to go with flexbox implementation, you could wrap your .box in flex and have a justify-content: center; to have an horizontal alignment.
Add the below update in your css for flexbox
.box {
display: flex;
justify-content: center;
}
Working flexbox fiddle
body {
background-color: rgb(231, 59, 59);
font-family: "Alata";
font-size: 20px;
margin: 30px;
}
h1 {
margin-top: 100px;
color: #202124;
text-align: center;
}
.box {
max-width: 1000px;
display: flex;
justify-content: center;
}
input {
position: relative;
display: inline-block;
box-sizing: border-box;
}
input[type="text"] {
background: #fff;
width: 600px;
height: 50px;
padding: 0 10px;
border: none;
outline: none;
border-radius: 25px 0 0 25px;
font-size: 15px;
}
button {
left: -5px;
position: relative;
border-radius: 0 25px 25px 0;
width: 110px;
height: 50px;
border: none;
outline: none;
cursor: pointer;
background: #ffc170;
color: #fff;
font-size: 21px;
}
<h1>This is my page title...</h1>
<div class="box">
<form>
<input type="text" name="" placeholder="Search here" />
<button type="button">Search</button>
</form>
</div>
Please note I have made use of max-width: 1000px; for .box in both examples. This is to make sure that the ui wont fail in the SO fiddle. You can update that as your requirement.

Can't get Image to float to the top. Need it next to the form in the page

I have the image formated how I want, I just can't get it to float to the top so it looks nice next to the form I made. I have tried making a div and having that float up to no avail. Help?
header {
background-color: #030303;
color: #ffffff;
height: 60px;
text-align: left;
padding-top: 30px;
padding-left: 3em;
background-image: url("assets/dndlogo.jpg");
background-repeat: no-repeat;
background-position: right;
}
#dndlogo {
float: right;
height: 50px;
}
header h1 {
font-family: Georgia, "Times New Roman", Serif;
margin-top: 0px;
font-size: 3em;
letter-spacing: 0.25em;
}
#schedulebox {
float: left;
height: 750px;
width: 15%;
float: left;
background-color: #bd0202;
text-align: center;
}
#homecontent {
height: 750px;
width: 84.3%;
float: left;
background-color: #030303;
color: white;
}
nav {
overflow: hidden;
background-color: #030303;
font-family: Arial;
float: top;
margin: 0;
padding: 0;
border-radius: 10px;
}
nav li {
float: left;
font-size: 20px;
color: black;
text-align: center;
padding: 15px 20px;
text-decoration: none;
list-style-type: none;
color: white;
height: 15px;
}
/*nav li:hover{
background-color: white;
border-radius: 15px;
transition: 0.5s;
color: black;
}*/
nav ul {
margin: 0;
padding-bottom: 10px;
padding-left: 0;
}
footer {
background-color: #030303;
float: bottom;
color: white;
}
#schedulebox h1 {
border-bottom: solid;
padding-top: 0;
margin: 0;
}
html {
background-color: #030303;
}
button {
background-color: #030303;
border: none;
color: white;
font-size: 20px;
height: 27px;
}
button:hover {
background-color: white;
color: #030303;
border-radius: 5px;
transition: 0.5s;
}
main {
border: white solid;
border-radius: 10px;
order-radius: 10px;
}
#wrapper {
padding: 20px;
}
#schedulebox {
border-right: white solid;
}
#dragonpic {
width: 1556.5px;
height: auto;
}
#homecontent2 {
border: solid white;
}
.clearfix::after {
content: "";
clear: both;
display: table;
}
#homecontent h2,
#homecontent h3 {
padding-left: 10px;
}
#resourcescontent {
color: white;
padding-left: 10px;
}
a img:visited {
border: black;
}
a img:hover {
border: white solid;
border-width: thin;
transition: 0.3s;
}
a.button {
-webkit-appearance: button;
-moz-appearance: button;
border: none;
color: white;
text-decoration: none;
height: 20px;
padding: 5px;
font-size: 20px;
}
a.button:hover {
background-color: white;
color: #030303;
transition: 0.3s;
border-radius: 5px;
}
#beyondlogo {
margin-left: auto;
margin-right: auto;
width: 50%;
display: block;
border-radius: 10px;
}
#resourcescontent p,
#resourcescontent h2 {
text-align: center;
}
form {
color: white;
}
label {
float: left;
display: block;
text-align: right;
width: 120px;
padding-right: 1em;
}
input,
textarea {
display: block;
margin-bottom: 20px;
}
#joiningcontent h2 {
color: white;
padding-left: 20px;
width: 20%;
text-align: center;
}
#joiningpic {
margin-left: auto;
margin-bottom: auto;
width: 50%;
display: block;
border-radius: 10px;
}
#joiningcontent {}
<div id="wrapper">
<header>
<h1>Dungeons and Dragons: WCTC</h1>
</header>
<main class="clearfix">
<nav>
<ul>
<li>Home</li>
<li>Resources</li>
<li>Join Us!</li>
</ul>
</nav>
<div id="joiningcontent">
<h2>If you wish to join, provide us with some information so we can contact you!</h2>
<form>
<label for="FirstName">First Name:</label>
<input type="text" id="FirstName" name="FName" required>
<label for="LastName">Last Name:</label>
<input type="text" id="LastName" name="LName" required>
<label for="emailboi">Email:</label>
<input type="email" id="emailboi" name="Email" required>
<label for="GuestOrMember">Are you signing up as a Guest?</label>
<input id="GuestOrMember" type="checkbox">
<button type="submit" value="submit">Submit</button>
</form>
<img src="assets/signuppic.png" id="joiningpic">
</div>
</main>
</div>
I'm still a little lost on what to do and I'm fairly new to web development so I appologize for any ameteur mistakes made.
For both the img and the form you need to:
float: left;
display: inline;
This is due to the form being a block level element so you need to float both left and set them to be inline, rather than block. If you put img before form then it will be on the left of the form, put it after the form and it will be on the right of the form.
Be aware that if the image and form do not fit within the width of the browser window then they will wrap and one will be below the other, whichever way round you have them.
https://jsfiddle.net/bryanwadd/o1da8buw/
For correct working float, the floated element should be the first. Just move img as a first element in parent, like this:
<!DOCTYPE html>
<html lang="en">
<link rel="stylesheet" href="style.css" type="text/css">
<head>
<meta charset="UTF-8">
<title>Sign Up</title>
</head>
<body>
<div id="wrapper">
<header>
<h1>Dungeons and Dragons: WCTC</h1>
</header>
<main class="clearfix">
<nav><ul><li>Home</li> <li>Resources</li> <li>Join Us!</li></ul></nav>
<div id="joiningcontent">
<img src="assets/signuppic.png" id="joiningpic">
<h2>If you wish to join, provide us with some information so we can contact you!</h2>
<form>
<label for="FirstName">First Name:</label>
<input type="text" id="FirstName" name="FName" required>
<label for="LastName">Last Name:</label>
<input type="text" id="LastName" name="LName" required>
<label for="emailboi">Email:</label>
<input type="email" id="emailboi" name="Email" required>
<label for="GuestOrMember">Are you signing up as a Guest?</label>
<input id="GuestOrMember" type="checkbox">
<button type="submit" value="submit">Submit</button>
</form>
</div>
</main>
</div>
</body>
</html>
UPDATED2
header{
background-color: #030303;
color:#ffffff;
height: 60px;
text-align: left;
padding-top: 30px;
padding-left: 3em;
background-image: url("assets/dndlogo.jpg");
background-repeat: no-repeat;
background-position: right;
}
#dndlogo{
float: right;
height: 50px;
}
header h1{
font-family: Georgia, "Times New Roman", Serif;
margin-top: 0px;
font-size: 3em;
letter-spacing: 0.25em;
}
#schedulebox{
float: left;
height: 750px;
width: 15%;
float: left;
background-color: #bd0202;
text-align: center;
}
#homecontent{
height: 750px;
width: 84.3%;
float: left;
background-color: #030303;
color: white;
}
nav {
overflow: hidden;
background-color: #030303;
font-family: Arial;
float: top;
margin: 0;
padding: 0;
border-radius: 10px;
}
nav li{
float: left;
font-size: 20px;
color: black;
text-align: center;
padding: 15px 20px;
text-decoration: none;
list-style-type: none;
color: white;
height: 15px;
}
/*nav li:hover{
background-color: white;
border-radius: 15px;
transition: 0.5s;
color: black;
}*/
nav ul{
margin: 0;
padding-bottom: 10px;
padding-left: 0;
}
footer{
background-color: #030303;
float: bottom;
color: white;
}
#schedulebox h1{
border-bottom: solid;
padding-top: 0;
margin: 0;
}
html{
background-color: #030303;
}
button{
background-color: #030303;
border: none;
color: white;
font-size: 20px;
height: 27px;
}
button:hover{
background-color: white;
color: #030303;
border-radius: 5px;
transition: 0.5s;
}
main{
border: white solid;
border-radius: 10px;
order-radius: 10px;
}
#wrapper{
padding: 20px;
}
#schedulebox{
border-right: white solid;
}
#dragonpic{
width: 1556.5px;
height: auto;
}
#homecontent2{
border: solid white;
}
.clearfix::after {
content: "";
clear: both;
display: table;
}
#homecontent h2, #homecontent h3{
padding-left: 10px;
}
#resourcescontent{
color: white;
padding-left: 10px;
}
a img:visited{
border: black;
}
a img:hover{
border: white solid;
border-width: thin;
transition: 0.3s;
}
a.button {
-webkit-appearance: button;
-moz-appearance: button;
border: none;
color: white;
text-decoration: none;
height: 20px;
padding: 5px;
font-size: 20px;
}
a.button:hover{
background-color: white;
color: #030303;
transition: 0.3s;
border-radius: 5px;
}
#beyondlogo{
margin-left: auto;
margin-right: auto;
width: 50%;
display: block;
border-radius: 10px;
}
#resourcescontent p, #resourcescontent h2{
text-align: center;
}
form{
color: white;
display: inline-block;
vertical-align: top;
max-width: 40%;
box-sizing: border-box;
}
label{
float: left;
display: block;
text-align: right;
width: 120px;
padding-right: 1em;
}
input, textarea{
display: block;
margin-bottom: 20px;
}
#joiningcontent h2{
color: white;
padding-left: 20px;
width: 20%;
text-align: center;
}
#joiningpic{
margin-left: auto;
margin-bottom: auto;
width: 50%;
border-radius: 10px;
display: inline-block;
vertical-align: top;
box-sizing: border-box;
}
#joiningcontent{
}
<div id="wrapper">
<header>
<h1>Dungeons and Dragons: WCTC</h1>
</header>
<main class="clearfix">
<nav><ul><li>Home</li> <li>Resources</li> <li>Join Us!</li></ul></nav>
<div id="joiningcontent">
<h2>If you wish to join, provide us with some information so we can contact you!</h2>
<form>
<label for="FirstName">First Name:</label>
<input type="text" id="FirstName" name="FName" required>
<label for="LastName">Last Name:</label>
<input type="text" id="LastName" name="LName" required>
<label for="emailboi">Email:</label>
<input type="email" id="emailboi" name="Email" required>
<label for="GuestOrMember">Are you signing up as a Guest?</label>
<input id="GuestOrMember" type="checkbox">
<button type="submit" value="submit">Submit</button>
</form>
<img src="assets/signuppic.png" id="joiningpic">
</div>
</main>
</div>

How to move the text higher in input label and do enter when reaching end line?

I have input label where there might be a lot of text.
how it looks now
I would like to have this 'Type something' in the left up corner. What is more, I would like to have an enter when we are closing to right border (end line). Currently it looks like this:
not making enter when reaching end line
I would like to have enter there.
Could you tell me how can I make these two improvements?
* {
margin: 0;
padding: 0;
}
header {
width: 1920;
height: 1080px;
}
body {
display: flex;
flex-direction: column;
min-height: 100vh;
margin: 0;
height: 1080px;
width: auto;
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;
}
#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;
}
<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>
<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>
<label><input type="something" name="something" placeholder='Type something' id="something" style="margin-top: 550px; position:absolute;left:0px; top:0px;"></label><br></p>
<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>
</div>
</article>
</section>
</header>
<footer>
<img src="social/instagram.png" />
<img src="social/twitter-white-logo.png" />
<img src="social/facebook.png" />
</footer>
I would suggest using a textarea for that. I made some changes to the CSS also
* {
margin: 0;
padding: 0;
}
header {
width: 1920;
height: 1080px;
}
body {
display: flex;
flex-direction: column;
min-height: 100vh;
margin: 0;
height: 1080px;
width: auto;
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;
}
#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,
article textarea {
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: 300px;
height: 150px;
text-align: justify;
}
<!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>
<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>
<label><textarea name="something" placeholder='Type something' id="something" cols="50" rows="15" style="margin-top: 550px; position:absolute;left:0px; top:0px;"></textarea></label><br>
<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>
</div>
</article>
</section>
</header>
<footer>
<img src="social/instagram.png" />
<img src="social/twitter-white-logo.png" />
<img src="social/facebook.png" />
</footer>
</body>
</html>

Checkbox disappear

I'm trying to get my checkbox inline with the text using display:block and display:inline. When I use this the checkbox disappear and don't show the full size.
I have tried to read and find other ways to solve this but I'm stuck.
Is there any other way to get the checkbox in same line as the text?
Please help a student :)
grid_newsletter {
background: #ffeb3a;
}
.grid_newsletter .text {
text-align: center;
font-size: 24px;
font-weight: 600;
margin-bottom: 41px;
}
.grid_newsletter input {
width: 380px;
border-top: transparent;
border-left: transparent;
border-right: transparent;
margin-left: 20px;
border-bottom: 2px solid black;
padding-left: 0px;
}
.grid_newsletter input[type="checkbox"] {
width: 22px;
height: 22px;
border: 2px solid black;
text-align: center;
display: inline;
}
.grid_newsletter .checkbox_terms {
margin-top: 23px;
display: block;
}
.grid_newsletter .content {
text-align: center;
padding: 70px 55px 30px 60px;
display: inline;
}
.grid_newsletter .text_box_newsletter {
background: white;
width: 495px;
height: 90px;
text-align: center;
margin-top: 27px;
margin-left: auto;
margin-right: auto;
}
.grid_newsletter .text_box_newsletter p {
padding-top: 39px;
padding-bottom: 35px;
text-align: center;
font-weight: 600;
font-size: 18px;
letter-spacing: 0.100em;
}
<div class="grid_newsletter">
<div class="content">
<div class="text">Newsletter!</div>
<form>
<input type="text" name="firstname" placeholder="förnamn">
<input type="email" name="email" placeholder="e-post">
</form>
<div class="checkbox_terms">
<input type="checkbox" name="confirm">
<span class="save">Jag godkänner att mina uppgifter lagras.</span>
<span class="terms">Läs mer om vår hantering av data och vår integritetspolicy här.</span>
</div> <!-- checkbox_terms -->
<div class="text_box_newsletter">
<p>skicka</p>
</div>
</div> <!-- content -->
</div> <!-- grid_newsletter -->
`
You can use display: inline-block or display: inline together with vertical-align: middle on the involved elements.
grid_newsletter {
background: #ffeb3a;
}
.grid_newsletter .text {
text-align: center;
font-size: 24px;
font-weight: 600;
margin-bottom: 41px;
}
.grid_newsletter input {
width: 380px;
border-top: transparent;
border-left: transparent;
border-right: transparent;
margin-left: 20px;
border-bottom: 2px solid black;
padding-left: 0px;
}
.grid_newsletter input[type="checkbox"] {
width: 22px;
height: 22px;
border: 2px solid black;
text-align: center;
display: inline;
}
.grid_newsletter .checkbox_terms {
margin-top: 23px;
display: block;
}
.grid_newsletter .content {
text-align: center;
padding: 70px 55px 30px 60px;
display: inline;
}
.grid_newsletter .text_box_newsletter {
background: white;
width: 495px;
height: 90px;
text-align: center;
margin-top: 27px;
margin-left: auto;
margin-right: auto;
}
.grid_newsletter .text_box_newsletter p {
padding-top: 39px;
padding-bottom: 35px;
text-align: center;
font-weight: 600;
font-size: 18px;
letter-spacing: 0.100em;
}
.vAlign {
display: inline-block;
vertical-align: middle;
}
<div class="grid_newsletter">
<div class="content">
<div class="text">Newsletter!</div>
<form>
<input type="text" name="firstname" placeholder="förnamn">
<input type="email" name="email" placeholder="e-post">
</form>
<div class="checkbox_terms">
<input type="checkbox" name="confirm" class="vAlign">
<span class="save vAlign">Jag godkänner att mina uppgifter lagras.</span>
<span class="terms vAlign">Läs mer om vår hantering av data och vår integritetspolicy här.</span>
</div> <!-- checkbox_terms -->
<div class="text_box_newsletter">
<p>skicka</p>
</div>
</div> <!-- content -->
</div> <!-- grid_newsletter -->
When You use the display block you have to give it a width and height and float left so it will act line inline for that part.
You can also use the height according to your need .
I hope this is what you were looking for .
grid_newsletter {
background: #ffeb3a;
}
.grid_newsletter .text {
text-align: center;
font-size: 24px;
font-weight: 600;
margin-bottom: 41px;
}
.grid_newsletter input {
width: 380px;
border-top: transparent;
border-left: transparent;
border-right: transparent;
margin-left: 20px;
border-bottom: 2px solid black;
padding-left: 0px;
}
.grid_newsletter input[type="checkbox"] {
border: 2px solid black;
text-align: center;
display: block;
width: 20px;
height:15px;
float: left;
}
.grid_newsletter .checkbox_terms {
margin-top: 23px;
display: block;
}
.grid_newsletter .content {
text-align: center;
padding: 70px 55px 30px 60px;
display: inline;
}
.grid_newsletter .text_box_newsletter {
background: white;
width: 495px;
height: 90px;
text-align: center;
margin-top: 27px;
margin-left: auto;
margin-right: auto;
}
.grid_newsletter .text_box_newsletter p {
padding-top: 39px;
padding-bottom: 35px;
text-align: center;
font-weight: 600;
font-size: 18px;
letter-spacing: 0.100em;
}
<div class="grid_newsletter">
<div class="content">
<div class="text">Newsletter!</div>
<form>
<input type="text" name="firstname" placeholder="förnamn">
<input type="email" name="email" placeholder="e-post">
</form>
<div class="checkbox_terms">
<input type="checkbox" name="confirm">
<span class="save">Jag godkänner att mina uppgifter lagras.</span>
<span class="terms">Läs mer om vår hantering av data och vår integritetspolicy här.</span>
</div> <!-- checkbox_terms -->
<div class="text_box_newsletter">
<p>skicka</p>
</div>
</div> <!-- content -->
</div> <!-- grid_newsletter -->
use vertical-align:middle as shown below for textbox:
.grid_newsletter input[type="checkbox"] {
width: 22px;
height: 22px;
border: 2px solid black;
text-align: center;
display: inline;
vertical-align: middle;/*Newly added*/
}