When the window is smaller, text on the first line:
"FILE FORMATS (XLS, XLSX, CSV OR OTHER DELIMITED, ODS)"
doesn't push the separating border down with it.
Screenshot of problem.
CSS:
.pricing-features-item {
border-top: 2px solid #000000;
font-size: 10px;
line-height: 1.5;
padding: 15px 0;
text-transform: uppercase;
text-align: left;
}
.col-tick {
float: left;
width: 10px;
}
.col-text {
float: left;
width: 90%;
}
HTML:
<ul class="pricing-features">
<li class="pricing-features-item">
<div class="col-tick">
+
</div>
<div class="col-text">
File formats (xls, xlsx, csv or other delimited, ods)
</div>
</li>
<li class="pricing-features-item">Dashboard hub</li>
<li class="pricing-features-item">Data filters and validation</li>
<li class="pricing-features-item">Premium data layout templates</li>
</ul>
How can i fix this?
If you could fix it here and send the link would be awesome :)
https://jsfiddle.net/nusmsegn/2/
That's because of float property inside .pricing-features-item, add float left to this element with width: 100%; and your problem will be solved, like:
.pricing-features-item {
float: left;
width: 100%;
border-top: 2px solid #000000;
font-size: 10px;
line-height: 1.5;
padding: 15px 0;
text-transform: uppercase;
text-align: left;
}
Have a look at the snippet below, or look at the updated fiddle
html {
box-sizing: border-box;
font-family: 'Open Sans', sans-serif;
}
*,
*:before,
*:after {
box-sizing: inherit;
}
.pricing-background {
padding: 120px 4% 4%;
position: relative;
width: 100%;
}
.pricing-background::after {
content: '';
background: #3498db;
background: -moz-linear-gradient(top, #60a9ff 0%, #4394f4 100%);
background: -webkit-linear-gradient(top, #3498db 0%, #4394f4 100%);
background: linear-gradient(to bottom, #3498db 0%, #4394f4 100%);
filter: progid: DXImageTransform.Microsoft.gradient( startColorstr='#3498db', endColorstr='#4394f4', GradientType=0);
height: 600px;
left: 0;
position: absolute;
top: 0;
width: 100%;
z-index: -1;
}
#media (min-width: 900px) {
.background {
padding: 0 0 25px;
}
}
.pricing-container {
margin: 0 auto;
padding: 75px 0 0;
max-width: 1280px;
width: 100%;
}
.panel {
background-color: #fff;
border-radius: 5px;
padding: ;
position: relative;
width: 100%;
z-index: 10;
}
.pricing-table {
display: flex;
flex-direction: column;
align-items: center;
position: relative;
}
#media (min-width: 900px) {
.pricing-table {
flex-direction: row;
}
}
price .pricing-table * {
text-align: center;
}
.pricing-desc {
padding: 50px 150px 0 150px;
}
.pricing-item {
border-top: 1px solid #e1f1ff;
font-size: 10px;
line-height: 1.5;
padding: 15px 0 15px;
text-transform: uppercase;
text-align: left;
}
pricing-item:last-child {
border-bottom: 1px solid #e1f1ff;
}
.pricing-plan {
border-bottom: 2px solid #e0e0e0;
padding: 50px;
}
.pricing-plan:last-child {
border-bottom: none;
}
#media (min-width: 960px) {
.pricing-plan {
border-bottom: none;
border-right: 1px solid #000000;
flex-basis: 100%;
padding: 25px 25px;
}
}
.pricing-plan:last-child {
border-right: none;
}
.pricing-plan-silver {
border-bottom: 2px solid #282929;
padding: 50px;
background: #282929;
}
.pricing-plan-silver:last-child {
border-bottom: none;
}
#media (min-width: 960px) {
.pricing-plan-silver {
border-bottom: none;
border-right: 1px solid #f1f1f1;
flex-basis: 100%;
padding: 25px 25px;
}
}
.pricing-plan-silver:last-child {
border-right: none;
}
.pricing-img {
padding: 20px;
margin-bottom: 25px;
max-width: 100%;
}
.pricing-header {
color: #808080;
font-weight: 600;
letter-spacing: 1px;
}
.pricing-headerinfo {
font-family: Lato, "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #ffffff;
font-size: 32px;
line-height: 48px;
font-weight: 300px;
}
.pricing-features {
color: #266a98;
font-weight: 600;
letter-spacing: 1px;
margin: 25px 0 25px;
padding: 25px 10px 0 10px;
}
.col-tick {
float: left;
width: 10px;
}
.col-text {
float: left;
width: 90%;
}
.pricing-features-item {
border-top: 2px solid #000000;
font-size: 10px;
line-height: 1.5;
padding: 15px 0;
text-transform: uppercase;
text-align: left;
float: left;
width: 100%;
}
.pricing-features-item:last-child {
border-bottom: 2px solid #e1f1ff;
}
/*## Gold list ##*/
.pricing-features-gold {
color: #494742;
font-weight: 600;
letter-spacing: 1px;
margin: 25px 0 25px;
padding: 25px 10px 0 10px;
}
.pricing-features-gold-item {
border-top: 1px solid #e0d7c1;
font-size: 10px;
line-height: 1.5;
padding: 15px 0;
text-transform: uppercase;
text-align: left;
}
.pricing-features-gold-item:last-child {
border-bottom: 1px solid #e0d7c1;
}
<div class="pricing-background">
<div class="pricing-container">
<div class="panel pricing-table">
<div class="pricing-plan">
<ul class="pricing-features">
<li class="pricing-features-item">
<div class="col-tick">
+
</div>
<div class="col-text">
File formats (xls, xlsx, csv or other delimited, ods)
</div>
</li>
<li class="pricing-features-item">Dashboard hub</li>
<li class="pricing-features-item">Data filters and validation</li>
<li class="pricing-features-item">Premium data layout templates</li>
<li class="pricing-features-item">Scheduling</li>
<li class="pricing-features-item">REST/API Connections (xml, json)</li>
<li class="pricing-features-item">FTP pickup / drop-off</li>
<li class="pricing-features-item">Two-way synchronisation</li>
<li class="pricing-features-item">Support</li>
<li class="pricing-features-item">X</li>
</ul>
</div>
</div>
</div>
</div>
Hope this helps!
This is an issue related to float property. You have applied float for the child elements while there is no float for parent
You can fix this in two different ways as below
Apply float: left; for ".pricing-features-item". You also may have to apply width: 100% here
Apply overflow: hidden; for ".pricing-features-item"
It depends upon your task. Hope this helps! cheers!
Just remove the float:left from col-text.
.pricing-features-item {
border-top: 2px solid #000000;
font-size: 10px;
line-height: 1.5;
padding: 15px 0;
text-transform: uppercase;
text-align: left;
}
.col-tick {
float: left;
margin-right: 8px;
}
.col-text {}
<ul class="pricing-features">
<li class="pricing-features-item">
<div class="col-tick">+</div>
<div class="col-text">
File formats (xls, xlsx, csv or other delimited, ods)
</div>
</li>
<li class="pricing-features-item">Dashboard hub</li>
<li class="pricing-features-item">Data filters and validation</li>
<li class="pricing-features-item">Premium data layout templates</li>
</ul>
Working fiddle link : https://jsfiddle.net/nusmsegn/4/
Float: left > removed from your css file:
HTML:
<div class="pricing-background">
<div class="pricing-container">
<div class="panel pricing-table">
<div class="pricing-plan">
<ul class="pricing-features">
<li class="pricing-features-item">
<div class="col-tick">
+
</div>
<div class="col-text">
File formats (xls, xlsx, csv or other delimited, ods)
</div>
</li>
<li class="pricing-features-item">Dashboard hub</li>
<li class="pricing-features-item">Data filters and validation</li>
<li class="pricing-features-item">Premium data layout templates</li>
<li class="pricing-features-item">Scheduling</li>
<li class="pricing-features-item">REST/API Connections (xml, json)</li>
<li class="pricing-features-item">FTP pickup / drop-off</li>
<li class="pricing-features-item">Two-way synchronisation</li>
<li class="pricing-features-item">Support</li>
<li class="pricing-features-item">X</li>
</ul>
</div>
</div>
</div>
</div>
CSS:
html {
box-sizing: border-box;
font-family: 'Open Sans', sans-serif;
}
*,
*:before,
*:after {
box-sizing: inherit;
}
.pricing-background {
padding: 120px 4% 4%;
position: relative;
width: 100%;
}
.pricing-background::after {
content: '';
background: #3498db;
background: -moz-linear-gradient(top, #60a9ff 0%, #4394f4 100%);
background: -webkit-linear-gradient(top, #3498db 0%, #4394f4 100%);
background: linear-gradient(to bottom, #3498db 0%, #4394f4 100%);
filter: progid: DXImageTransform.Microsoft.gradient( startColorstr='#3498db', endColorstr='#4394f4', GradientType=0);
height: 600px;
left: 0;
position: absolute;
top: 0;
width: 100%;
z-index: -1;
}
#media (min-width: 900px) {
.background {
padding: 0 0 25px;
}
}
.pricing-container {
margin: 0 auto;
padding: 75px 0 0;
max-width: 1280px;
width: 100%;
}
.panel {
background-color: #fff;
border-radius: 5px;
padding: ;
position: relative;
width: 100%;
z-index: 10;
}
.pricing-table {
display: flex;
flex-direction: column;
align-items: center;
position: relative;
}
#media (min-width: 900px) {
.pricing-table {
flex-direction: row;
}
}
price .pricing-table * {
text-align: center;
}
.pricing-desc {
padding: 50px 150px 0 150px;
}
.pricing-item {
border-top: 1px solid #e1f1ff;
font-size: 10px;
line-height: 1.5;
padding: 15px 0 15px;
text-transform: uppercase;
text-align: left;
}
pricing-item:last-child {
border-bottom: 1px solid #e1f1ff;
}
.pricing-plan {
border-bottom: 2px solid #e0e0e0;
padding: 50px;
}
.pricing-plan:last-child {
border-bottom: none;
}
#media (min-width: 960px) {
.pricing-plan {
border-bottom: none;
border-right: 1px solid #000000;
flex-basis: 100%;
padding: 25px 25px;
}
}
.pricing-plan:last-child {
border-right: none;
}
.pricing-plan-silver {
border-bottom: 2px solid #282929;
padding: 50px;
background: #282929;
}
.pricing-plan-silver:last-child {
border-bottom: none;
}
#media (min-width: 960px) {
.pricing-plan-silver {
border-bottom: none;
border-right: 1px solid #f1f1f1;
flex-basis: 100%;
padding: 25px 25px;
}
}
.pricing-plan-silver:last-child {
border-right: none;
}
.pricing-img {
padding: 20px;
margin-bottom: 25px;
max-width: 100%;
}
.pricing-header {
color: #808080;
font-weight: 600;
letter-spacing: 1px;
}
.pricing-headerinfo {
font-family: Lato, "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #ffffff;
font-size: 32px;
line-height: 48px;
font-weight: 300px;
}
.pricing-features {
color: #266a98;
font-weight: 600;
letter-spacing: 1px;
margin: 25px 0 25px;
padding: 25px 10px 0 10px;
}
.col-tick {
float: left;
width: 10px;
}
.col-text {
width: 90%;
}
.pricing-features-item {
border-top: 2px solid #000000;
font-size: 10px;
line-height: 1.5;
padding: 15px 0;
text-transform: uppercase;
text-align: left;
}
.pricing-features-item:last-child {
border-bottom: 2px solid #e1f1ff;
}
/*## Gold list ##*/
.pricing-features-gold {
color: #494742;
font-weight: 600;
letter-spacing: 1px;
margin: 25px 0 25px;
padding: 25px 10px 0 10px;
}
.pricing-features-gold-item {
border-top: 1px solid #e0d7c1;
font-size: 10px;
line-height: 1.5;
padding: 15px 0;
text-transform: uppercase;
text-align: left;
}
.pricing-features-gold-item:last-child {
border-bottom: 1px solid #e0d7c1;
}
Related
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>
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>
I am working on Expandable Search but facing one problem. When i click on search bar then search bar is expanding. But right side content is moving down. I wanna hide right side content when search bar is expand similar to stackoverflow search bar.
body {
margin: 0;
padding: 0;
}
.mainheader {
width: 100%;
background-color: #FAFAFB;
border-top: 3px solid #F48024;
float: left;
padding-bottom: 10px;
-moz-box-shadow: 3px 3px 5px 1px #ccc;
-webkit-box-shadow: 3px 3px 5px 1px #ccc;
box-shadow: 3px 3px 5px 1px #ccc;
}
.innerheader {
width: 1000px;
margin: auto;
}
.logo_name {
display: inline-block;
margin-top: 13px;
line-height: 1em;
font-family: helvetica, arial, sans-serif;
font-weight: bold;
background: linear-gradient(to right, #7db9e8 50%,#1e5799 50%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-size: 22px;
}
.ga_a {
float: left;
}
.ga_b {
float: left;
padding: 5px;
padding-bottom: 10px;
margin-top: 5px;
}
.ga_b ul {
margin: 0px;
padding: 0px;
margin-left: 7px;
line-height:1;
}
.ga_b ul>li {
display:inline-block;
margin-left: 5px;
padding: 5px;
}
.ga_b ul>li a {
text-decoration: none;
color: black;
font-size: 15px;
font-family: "Lucida Grande",Arial,Helvetica,Verdana,sans-serif;
}
.ga_b ul>li:hover {
background-color: #ECECEC;
}
.ga_c {
float: left;
}
.ga_c input {
outline: none;
}
.ga_c input[type=search] {
-webkit-appearance: textfield;
-webkit-box-sizing: content-box;
font-family: inherit;
font-size: 100%;
margin-left: 10px;
}
.ga_c input::-webkit-search-decoration,
.ga_c input::-webkit-search-cancel-button {
display: none;
}
.ga_c input[type=search] {
background: #ededed url(https://static.tumblr.com/ftv85bp/MIXmud4tx/search-icon.png) no-repeat 9px center;
border: solid 1px #ffffff;
padding: 9px 10px 9px 32px;
width: 175px;
border-radius: 5px;
margin-top: 5px;
-webkit-transition: all .5s;
-moz-transition: all .5s;
transition: all .5s;
}
.ga_c input[type=search]:focus {
width: 400px;
background-color: #fff;
-webkit-box-shadow: 0 0 5px rgba(109,207,246,.5);
-moz-box-shadow: 0 0 5px rgba(109,207,246,.5);
box-shadow: 0 0 5px rgba(109,207,246,.5);
}
.ga_c input:-moz-placeholder {
color: #999;
}
.ga_c input::-webkit-input-placeholder {
color: #999;
}
.ga_d {
float: left;
}
.ga_d ul>li {
display: inline-block;
display: fixed;
}
<div class="mainheader">
<div class="innerheader">
<div class="ga_a">
<a class="navbar-brand logo_name" href="#">WebSiteName</a>
</div>
<div class="ga_b">
<ul>
<li>Text One</li>
<li>Text Two</li>
<li>Text Three</li>
</ul>
</div>
<div class="ga_c">
<form>
<input type="search" placeholder="Search">
</form>
</div>
<div class="ga_d">
<ul>
<li>Login</li>
<li>Register</li>
</ul>
</div>
</div>
</div>
You can do it with the positioning:
* {box-sizing: border-box} /* recommended */
body {
margin: 0;
padding: 0;
}
.mainheader {
width: 100%;
min-width: 1000px; /* added / needs to match the .innerheader width */
margin: 0 auto; /* added */
background-color: #FAFAFB;
border-top: 3px solid #F48024;
float: left;
padding-bottom: 10px;
-moz-box-shadow: 3px 3px 5px 1px #ccc;
-webkit-box-shadow: 3px 3px 5px 1px #ccc;
box-shadow: 3px 3px 5px 1px #ccc;
}
.innerheader {
width: 1000px;
margin: 0 auto; /* modified */
}
.logo_name {
display: inline-block;
margin-top: 13px;
line-height: 1em;
font-family: helvetica, arial, sans-serif;
font-weight: bold;
background: linear-gradient(to right, #7db9e8 50%,#1e5799 50%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-size: 22px;
}
.ga_a {
float: left;
}
.ga_b {
float: left;
padding: 5px;
padding-bottom: 10px;
margin-top: 5px;
}
.ga_b ul {
margin: 0;
padding: 0;
margin-left: 7px;
line-height: 1;
}
.ga_b ul>li {
display:inline-block;
margin-left: 5px;
padding: 5px;
}
.ga_b ul>li>a {
text-decoration: none;
color: #000; /*black*/
font-size: 15px;
font-family: "Lucida Grande",Arial,Helvetica,Verdana,sans-serif;
}
.ga_b ul>li:hover {
background: #ECECEC;
}
.ga_c {
position: relative; /* needs to be set because of the absolute positioned child */
float: left;
}
.ga_c input {
outline: none;
}
.ga_c input[type=search] {
position: absolute; /* needs to be positioned absolutely, i.e. be removed from the normal document flow so that it can "overlay" and other element, of course the z-index needs to be set */
z-index: 9999; /* usually something big just to be sure it stays on top / in front of everything else */
-webkit-appearance: textfield;
-webkit-box-sizing: content-box;
font-family: inherit;
font-size: 100%;
margin-left: 10px;
}
.ga_c input::-webkit-search-decoration,
.ga_c input::-webkit-search-cancel-button {
display: none;
}
.ga_c input[type=search] {
background: #ededed url(https://static.tumblr.com/ftv85bp/MIXmud4tx/search-icon.png) no-repeat 9px center;
border: solid 1px #fff;
padding: 9px 10px 9px 32px;
width: 175px;
border-radius: 5px;
margin-top: 5px;
-webkit-transition: all .5s;
-moz-transition: all .5s;
transition: all .5s;
}
.ga_c input[type=search]:focus {
width: 400px;
background-color: #fff;
-webkit-box-shadow: 0 0 5px rgba(109,207,246,.5);
-moz-box-shadow: 0 0 5px rgba(109,207,246,.5);
box-shadow: 0 0 5px rgba(109,207,246,.5);
}
.ga_c input:-moz-placeholder {
color: #999;
}
.ga_c input::-webkit-input-placeholder {
color: #999;
}
.ga_d {
position: relative; /* positioned relative to its normal position so that we can move it with "directional" properties */
left: 229px; /* moved to the right by the width of the .ga_c (inspected the element) */
float: left;
}
.ga_d ul>li {
display: inline-block;
display: fixed;
}
<div class="mainheader">
<div class="innerheader">
<div class="ga_a">
<a class="navbar-brand logo_name" href="#">WebSiteName</a>
</div>
<div class="ga_b">
<ul>
<li>Text One</li>
<li>Text Two</li>
<li>Text Three</li>
</ul>
</div>
<div class="ga_c">
<form>
<input type="search" placeholder="Search">
</form>
</div>
<div class="ga_d">
<ul>
<li>Login</li>
<li>Register</li>
</ul>
</div>
</div>
</div>
With your structure, it is not possible using css only. However if change the structure you could have something like this.
*{
box-sizing: border-box;
font-family: arial;
}
input{
padding: 10px;
background: #eee;
border: 1px solid #ddd;
display: inline-block;
transition: .3s;
margin-right: 10px;
width: 250px;
}
input:focus{
width: 400px;
}
input:focus + div{
opacity: 0;
visibility: hidden;
}
ul{
padding: 0;
margin: 0;
}
ul li{
display: inline;
margin-right: 5px;
}
div {
display: inline-block;
transition: .3s;
}
<input type="search" placeholder="Search">
<div class="ga_d">
<ul>
<li>Login</li>
<li>Register</li>
</ul>
</div>
HTML:
<div class="menu-panel">
<h3>Table of Contents</h3>
<ul id="menu-toc" class="menu-toc">
<li>Home</li>
<li style="border-top: #FFF solid 1px;" class="menu-toc-current">Biography</li>
<li>Extra Curricular</li>
<li>Favorites</li>
</ul>
</div>
<div class="main">
<h2>Biography</h2>
<p>THIS INFO SHOWS UP WITH HEAVY CSS EDITING</p>
</div>
CSS:
.menu-panel {
background: #013E7D;
width: 240px;
height: 100%;
position: fixed;
z-index: 1000;
top: 0;
left: 0;
text-shadow: 0 1px 1px rgba(0,0,0,0.1);
margin: 0px;
}
.menu-panel h3 {
font-family:Roboto;
font-size: 1.8em;
padding: 20px;
font-weight: 300;
color: #fff;
box-shadow: inset 0 -1px 0 rgba(0,0,0,0.05);
}
.menu-toc {
list-style: none;
}
.menu-toc li a {
font-family:Roboto;
display: block;
color: #C0C0C0;
font-size: 1.1em;
line-height: 3.5;
padding: 0 20px;
cursor: pointer;
background: #013E7D;
border-bottom: 1px solid #FFF;
}
.menu-toc li a:hover,
.menu-toc li.menu-toc-current a {
background: #000000;
}
.menu-panel div {
margin-top: 20px;
}
.menu-panel div a {
text-transform: uppercase;
font-size: 0.7em;
line-height: 1;
padding: 5px 20px;
display: block;
border: none;
color: #bc0b0b;
letter-spacing: 1px;
font-weight: 800;
text-shadow: 0 1px rgba(255,255,255,0.2);
}
#media screen and (max-width: 800px) {
.no-js .menu-panel {
display: none;
}
.no-js .container {
padding: 0;
}
#media screen and (max-width: 400px) {
.menu-panel,
.content {
font-size: 75%;
}
.main {
margin-left:797px;
position:fixed;
font-family:Roboto;
}
So basically I need to get the table of contents to be static so all other elements go around it!! I have been trying to fix this and it will not work. If you could help me it would help a lot! Thank you
.menu-panel {
background: #013E7D;
width: 240px;
height: 100%;
z-index: 1000;
top: 0;
left: 0;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
margin: 0px;
float: left;
}
in css removing the position and adding the float results in horizontally aligned blocks. see also http://codepen.io/anon/pen/XXJRWx
I'm trying to create this price column, and have been modifying the code of a tutorial, and everything was going fine until I added a border to .price section of it. The border added some extra width to the element, but only on the right side. I tried to see if another div was the reason, or some forgotten about margin/padding values with Chrome Dev Tools, but I can't see anything.
I would really appreciate any help with finding out what is causing the extra width to .price div
Here is the html:
<ul class="pricing_table">
<li></li>
<li class="price_block">
<h3>Web Development</h3>
<div class="price">
<div class="price_figure">
<span class="price_number">$9.99</span>
<span class="price_tenure">per month</span>
</div>
</div>
<ul class="features">
<li>2GB Storage</li>
<li>5 Clients</li>
<li>10 Active Projects</li>
<li>Free Goodies</li>
<li>24/7 Email support</li>
</ul>
<div class="buynow">
Buy Now
</div>
</li>
</ul>
Here is the CSS:
* {
margin: 0;
padding: 0;
}
li {
list-style:none;
}
body {
font-family: roboto;
}
h3 {
font-family: lato;
}
.pricing_table {
line-height: 150%;
font-size: 20px;
margin: 0 auto;
width: 75%;
max-width: 400px;
padding-top: 10px;
margin-top: 100px;
}
.price_block, .price_block_blue {
width: 100%;
color: black;
background-color: white;
float: left;
list-style-type: none;
transition: all 0.25s;
position: relative;
box-sizing: border-box;
margin-bottom: 10px;
}
.pricing_table h3 {
text-transform: uppercase;
padding: 5px 0;
background: white;
margin: -10px 0 0 0;
text-align: center;
border: 3px solid black;
border-bottom: 0px solid transparent;
}
.price {
display: table;
background: red;
width: 100%;
margin: 0;
padding: 0;
height: 70px;
text-align: center;
border: 3px solid black;
border-top:0px solid black;
border-bottom:0px solid black;
}
.price_blue {
display: table;
background: blue;
width: 100%;
height: 70px;
text-align: center;
}
.price_figure {
font-size: 24px;
text-transform: uppercase;
vertical-align: middle;
display: table-cell;
}
.price_number {
font-weight: bold;
padding: 10px 0 0 0;
display: block;
}
.price_tenure {
font-size: 11px;
}
.features {
background: #fff;
color: #000;
text-align: center;
border: 3px solid black;
border-bottom: 0px solid transparent;
border-top: 0px solid transparent;
}
.features li {
padding: 8px 15px;
border-bottom: 1px solid #ccc;
font-size: 11px;
list-style-type: none;
}
.buynow {
padding: 15px;
background: white;
text-align: center;
border: 3px solid black;
border-top: 0px solid black;
}
.action_button {
text-decoration: none;
color: white;
font-weight: bold;
border-radius: 5px;
background: red;
padding: 5px 20px;
font-size: 11px;
text-transform: uppercase;
}
.price_block:hover,.price_block_blue:hover {
box-shadow: 0 0 0px 5px rgba(0, 0, 0, 0.5);
transform: scale(1.04) translateY(-5px);
z-index: 1;
border-bottom: 0 none;
}
.price_block:hover .price {
background: yellow;
/*box-shadow: inset 0 0 45px 1px #ADD8E6;*/
}
.price_block_blue:hover .price_blue {
background: yellow;
}
.price_block:hover h3{
background: black;
color: white;
}
.price_block_blue:hover h3 {
background: black;
color: white;
}
.price_block:hover .action_button, .price_block_blue:hover .action_button {
background: linear-gradient(#F9B84A, #DB7224);
}
Since you are adding a border, it gets added to your overall width. So the actual width of .price is 100% + 3px (left border) + 3px (right border). To have the total width include padding and borders, use box-sizing:
.price {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}