Hello to all and to all,
I'm a Junior developer and its going to be almost two weeks long as I struggle on a topic. My code works very well for the desktop version and on all browsers (Chrome, EI, Firefox, Edge).
On the other hand when I want to view my page on mobile everything works well on safari but for se that is Firefox and chrome is the disaster.
I have the impression that there are classes of my CSS that are not supported. On the other hand when I put the style in inline mode in my page html everything works well, weird all its !!!
Hoping that a savior can help me find a solution. I put you below my html code and css.
Good day everyone.
body{
background-image: url('img/bg.jpg');
background-size: cover;
background-repeat: no-repeat;
font-family:Arial,Helvetica,sans-serif;
height: 1500px;
margin: 0px;
}
.verso{
width: 370px;
height:950px ;
margin-bottom: 0px;
}
.carteModeRecto{
text-align: -moz-center;
-webkit-box-align: center;
width: 370px;
text-align: left;
margin:auto;
text-align: -webkit-center;
}
.recto,.verso{
text-align: -webkit-center;
text-align: -moz-center;
text-align: -ms-center;
margin-bottom: 50px;
overflow: hidden;
margin-top: 50px;
background-color: white;
box-shadow: 1px 1px 5px 1px black;
}
#photoprofil{
background-image: url("img/photo_roger.jpg");
width: 238px;
height: 240px;
border-radius: 150px;
margin-top: 11px;
text-align: left;
margin: auto;
margin-top: 11px;
text-align: left;
margin: auto;
}
#photoprofil2{
border: 3px solid #e5e5e5;
width: 260px;
height: 250px;
border-radius: 150px 150px;
text-align: left;
margin: auto;
padding-top: 10px;
text-align: left;
margin: auto;
padding-top: 10px;
height: 250px;
}
.ligneinfo{
display: flex;
margin-top: 7px;
}
.buton,.buton2{
display: flex;
cursor: pointer;
background-color: #ca3439;
text-align: center;
border-radius: 10px;
color: white;
text-align: left;
margin:0 auto;
outline: none;
border: none;
border: 2px solid #cb353b;
}
.buton{
margin-bottom: 30px;
width: 280px;
height: 50px;
}
.buton2{
background-color: white;
color: #2e4158;
text-align: left;
margin:0 auto;
margin-bottom: 30px;
width: 280px;
height: 52px
}
.down{
margin-top: 8px;
}
.partag{
margin-top: 4px;
width: 42px;
height: 43px;
}
.qrcode{
border: 2px solid #cb353b;
border-radius: 10px;
margin-top: 50px;
}
.buttontext2,.buttontext{
color: #2e4158;
margin-top: 15px;
font-size: 1em;
}
.buttontext{
color: white;
}
.imgbutton,.imgbutton2{
margin-left: 20px;
height: 42px;
width: 58px;
margin-right: 20px;
margin-top: 8px;
}
.imgbutton2{
height: 42px;
width: 43px;
margin-top: 5px;
}
.info{
margin-left: 35px;
}
.nom,.statu{
font-size: 1.6em;
color: #2e4158;
margin-top: 40px;
text-align: center
}
.statu{
margin-bottom: 30px;
margin-top: 0px;
}
.texte{
margin-top: 5px;
margin-left: 10px;
color: #2e4158;
font-size: 1.2em;
}
.carte{
text-align: -moz-center;
-webkit-box-align: center;
width: 370px;
text-align: left;
margin:auto;
text-align: -webkit-center;
}
.carte_visite_recto_verso {
-webkit-perspective: 740px;
perspective: 740px;
margin-top: 50px;
}
.carte_visite_recto_verso .carte {
-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
}
.carte_visite_recto_verso .carte .couche {
margin:0px !important;
-webkit-transition: 1s;
transition: 1s;
-webkit-backface-visibility: hidden ;
backface-visibility: hidden ;
}
.carte_visite_recto_verso .carte .recto {
position: absolute;
z-index: 1;
}
.carte_visite_recto_verso .carteModeRecto .recto {
-webkit-transform: rotatey(-0deg);
transform: rotatey(-0deg);
}
.carte_visite_recto_verso .carteModeRecto .verso {
-webkit-transform: rotatey(-180deg);
transform: rotatey(-180deg);
}
.carte_visite_recto_verso .carteModeVerso .recto {
-webkit-transform: rotatey(+180deg);
transform: rotatey(+180deg);
}
.carte_visite_recto_verso .carteModeVerso .verso {
-webkit-transform: rotatey(0deg);
transform: rotatey(0deg);
}
a{
text-decoration: none;
color: #2e4158;
}
.iconinfo{
height: 29px;
width: 25px;
}
.logo{
width: 370px;
padding-top: 30px;
margin-bottom: 20px;
text-align: -webkit-center;
}
.reseaux{
text-align: left;
margin:0 auto;
margin-left:35px;
margin-top: 60px;
padding-bottom: 70px;
}
.qrcode{
text-align: left;
margin:0 auto;
width: 280px;
height: 330px;
}
.imgqr{
text-align: left;
margin:0 auto;
margin-left: 45px;
padding-top: 60px;
}
.imglogo{
width: 300px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="og:image" content="img/photo_roger.jpg">
<meta name="image" content="img/photo_roger.jpg">
<meta name="description" content="Location d'imprimantes et photocopieurs,
Location et vente de matériel informatique,Téléphonie Voip et débit internet,Solutions de commutation" />
<link rel="stylesheet" media="screen" type="text/css" href="style.css">
<title>Roger Duarte : Directeur Commercial - Axium Solutions </title>
<link rel="shortcut icon" href="img/logo2.jpg" type="image/jpg"/>
<link rel="icon" href="img/logo2.jpg" type="image/jpg"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>
<div class="carte_visite_recto_verso" >
<div class="carte carteModeRecto" >
<div class="couche recto" > <!--DEBUT DU MODE RECTO-->
<div class="logo">
<img src="img/logo.jpg" alt="" class="imglogo" >
</div>
<div> <!--PHOTO DU CLIENT-->
<div id="photoprofil2">
<div id="photoprofil"></div>
</div>
</div>
<div class="nom" >
Roger Duarte
</div>
<div class="statu" >
Directeur Commercial
</div>
<a href="download/vcard_roger.vcf" download>
<div class="buton2">
<img src="img/ico_download.jpg" alt="" class="imgbutton">
<div class="buttontext2" > Télécharger le contact</div>
</div></a>
<div class="buton"
onclick="$(document).find('.carte').toggleClass('carteModeVerso');
$(document).find('.carte').toggleClass('carteModeRecto');">
<img src="img/ico_partage.jpg" alt="" class="imgbutton2" >
<div class="buttontext" >Partager</div>
</div>
<div class="info">
<div class="ligneinfo" >
<img src="img/ico_mobile.jpg" alt="" class="iconinfo">
<div class="texte">01 84 00 86 21</div>
</div>
<div class="ligneinfo" >
<img src="img/ico_phone.jpg" alt="" class="iconinfo">
<div class="texte">06 62 68 25 03</div> <!--ZONE INFORMATION-->
</div>
<div class="ligneinfo" >
<img src="img/ico_sms.jpg" alt="" class="iconinfo">
<div class="texte">SMS</div>
</div>
<div class="ligneinfo" >
<img src="img/ico_mail.jpg" alt="" class="iconinfo">
<div class="texte" >Roger.duarte#axiumsolutions.fr</div>
</div>
<div class="ligneinfo" >
<img src="img/ico_web.jpg" alt="" class="iconinfo">
<div class="texte">www.axiumsolutions.fr</div>
</div>
<div class="ligneinfo" >
<img src="img/ico_adresse.jpg" alt="" class="iconinfo" >
<a href="https://goo.gl/maps/HdY48H9MVqRsX3KR9"><div class="texte" style="text-align: left;" >Immeuble Point Cardinal <br>
31 Avenue Pierre Brossolette <br>
91380 CHILLY MAZARIN</a>
</div>
</div>
</div>
<div class="reseaux" >
<div class="ligneinfo" >
<img src="img/ico_linkedin.jpg" alt="" class="iconinfo">
<div class="texte">Linkedin</div>
</div>
<div class="ligneinfo" > <!--ZONE RESEAUX SOCIAUX-->
<img src="img/ico_fb.jpg" alt="" class="iconinfo">
<div class="texte">Facebook</div>
</div>
</div> <!--FIN MODE RECTO-->
</div>
<div class="couche verso" > <!--DEBUT MODE VERSO-->
<div class="logo" >
<img src="img/logo.jpg" alt="" class="imglogo" >
</div>
<a href="vcard_roger.vcf" download>
<div class="buton2" >
<img src="img/ico_download.jpg" alt="" class="imgbutton" >
<div class="buttontext2" >Télécharger le contact</div>
</div></a>
<div class="buton2">
<img src="img/ico_mail2.jpg" alt="" class="imgbutton">
<div class="buttontext2" >Partager Par Mail</div> <!--ZONE DE PARTAGE-->
</div>
<div class="buton2" >
<img src="img/ico_whatsapp.jpg" alt="" class="imgbutton" >
<div class="buttontext2">Partager par Whatsapp</div>
</div>
<div class="buton2" >
<img src="img/ico_copier.jpg" alt="" class="imgbutton">
<div class="buttontext2" >Copier le lien</div>
</div>
<div class="buton"
onclick="$(document).find('.carte').toggleClass('carteModeVerso');
$(document).find('.carte').toggleClass('carteModeRecto');">
<img src="img/ico_retour.jpg" alt="" class="imgbutton2">
<div class="buttontext" >Retour</div>
</div>
<div class="qrcode" >
<img src="img/qr_code.jpg" alt="" class="imgqr" >
</div> <!--FIN DU MODE VERSO-->
</div>
</div>
</body>
</html>
try to use max-width instead of width. Max-width help to change size based on device size.
Example:
.verso{
width:100%;
max-width: 370px;
margin-bottom: 0px;
}
thank you for your help, unfortunately its not changing anything. I can post an image of itself that its gives on my mobile with firefox and chrome.
Mobile version on firefox and chrome
Mobile version on safari
i spend sometimes for searching about this and i found something , i hope it helpful :
checkout the link : https://dev.to/neshaz/how-to-make-all-browsers-understand-your-css-2a4e
Related
I wonder how can I change the line after the text "version 1" "version 2" and "version 3".
Those are inline, but if I change it into block or add br/ tag, the whole small boxes are broken into two parts, which is not intended.
Also, even I put the contents (p and images) in the small box, why does not contain whole contents?
.frame{
font-size: 50px;
background-color: black;
height: fit-content;
color: gold;
width: 1900px;
text-align: center;
margin-top: 50px;
margin-left: auto;
margin-right: auto;
padding-top: 20px;
padding-bottom: 20px;
}
.image{
margin-top: 30px;
display: inline-block;
margin-right: auto;
margin-left: auto;
width: 50px;
height: 50px;
}
.box{
background-color: transparent;
border-radius: 40;
font-size: 36px;
color: gold;
border: 6px solid white;
width: 1800px;
text-align: center;
margin-left: auto;
margin-right: auto;
border-radius: 40px;
margin-top: 40px;
padding: 20px;
}
#timeline{ margin-top: 30px;
color: white;
}
p{font-size: 22px;
color: white;
margin-bottom: 20px;
border-color: white;
text-align: center;
display: inline-block;
}
.smallbox{
background-color: transparent;
border: 4px solid white;
display: inline-block;
border-radius: 20px;
padding: 30px;
width: 270px;
height: 80px;
text-align: center;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>subimage</title>
<link rel="stylesheet" type="text/css" href="../css/st.css">
</head>
<body>
<div class="frame"> Project Directory
<div class="box">Repository
<div><img class="image" src="https://www.shareicon.net/data/128x128/2015/07/26/75287_doc_512x512.png">
<img class="image" src="https://ehs.utoronto.ca/wp-content/uploads/2021/06/pdf-icon-2.png">
<img class="image" src="https://pixy.org/src/162/thumbs350/1625091.jpg"></div>
<div id="timeline">------O--------------------O--------------------O------</div>
<div class="smallbox">
<p class="v1">version 1</p>
<img class="image" src="https://www.shareicon.net/data/128x128/2015/07/26/75287_doc_512x512.png"></div>
<div class="smallbox">
<p class="v2">version 2</p>
<img class="image" src="https://www.shareicon.net/data/128x128/2015/07/26/75287_doc_512x512.png">
<img class="image" src="https://ehs.utoronto.ca/wp-content/uploads/2021/06/pdf-icon-2.png">
</div>
<div class="smallbox">
<p class="v3">version 3</p>
<img class="image" src="https://www.shareicon.net/data/128x128/2015/07/26/75287_doc_512x512.png">
<img class="image" src="https://ehs.utoronto.ca/wp-content/uploads/2021/06/pdf-icon-2.png">
<img class="image" src="https://pixy.org/src/162/thumbs350/1625091.jpg">
</div>
</div>
</div>
</body>
</html>>
Make <p> display as block, remove margin from <p> and images next to it.
.frame{
font-size: 50px;
background-color: black;
height: fit-content;
color: gold;
width: 1900px;
text-align: center;
margin-top: 50px;
margin-left: auto;
margin-right: auto;
padding-top: 20px;
padding-bottom: 20px;
}
.image{
/*margin-top: 30px;*/ /* removed */
display: inline-block;
margin-right: auto;
margin-left: auto;
width: 50px;
height: 50px;
}
.box{
background-color: transparent;
border-radius: 40;
font-size: 36px;
color: gold;
border: 6px solid white;
width: 1800px;
text-align: center;
margin-left: auto;
margin-right: auto;
border-radius: 40px;
margin-top: 40px;
padding: 20px;
}
#timeline{ margin-top: 30px;
color: white;
}
p{font-size: 22px;
color: white;
margin-bottom: 20px;
border-color: white;
text-align: center;
display: block; /* changed */
margin: 0; /* added */
}
.smallbox{
background-color: transparent;
border: 4px solid white;
display: inline-block;
border-radius: 20px;
padding: 30px;
width: 270px;
height: 80px;
text-align: center;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>subimage</title>
<link rel="stylesheet" type="text/css" href="../css/st.css">
</head>
<body>
<div class="frame"> Project Directory
<div class="box">Repository
<div><img class="image" src="https://www.shareicon.net/data/128x128/2015/07/26/75287_doc_512x512.png">
<img class="image" src="https://ehs.utoronto.ca/wp-content/uploads/2021/06/pdf-icon-2.png">
<img class="image" src="https://pixy.org/src/162/thumbs350/1625091.jpg"></div>
<div id="timeline">------O--------------------O--------------------O------</div>
<div class="smallbox">
<p class="v1">version 1</p>
<img class="image" src="https://www.shareicon.net/data/128x128/2015/07/26/75287_doc_512x512.png"></div>
<div class="smallbox">
<p class="v2">version 2</p>
<img class="image" src="https://www.shareicon.net/data/128x128/2015/07/26/75287_doc_512x512.png">
<img class="image" src="https://ehs.utoronto.ca/wp-content/uploads/2021/06/pdf-icon-2.png">
</div>
<div class="smallbox">
<p class="v3">version 3</p>
<img class="image" src="https://www.shareicon.net/data/128x128/2015/07/26/75287_doc_512x512.png">
<img class="image" src="https://ehs.utoronto.ca/wp-content/uploads/2021/06/pdf-icon-2.png">
<img class="image" src="https://pixy.org/src/162/thumbs350/1625091.jpg">
</div>
</div>
</div>
</body>
</html>>
When I use my web-site on mobile devices width of container doesn't cover 100% of body. I set width to 100%, I tried to put min-width on body, but I have white line on right side of the screen. I also tried to change viewport width, but that doesn't work.
*{
margin: 0;
padding: 0;
}
body{
font-family: 'Bai Jamjuree', sans-serif;
overflow-x: hidden;
min-width: 1050px;
}
h1{
color: #535a62;
}
p{
font-weight: 600;
color: #a6a7a9;
}
.header{
background: url("https://via.placeholder.com/1200");
background-size: cover;
height: 300px;
padding: 130px 0 0 0;
}
.logo{
margin: auto;
width: 125px;
height: 125px;
}
.title{
width: 690px;
height: 225px;
margin: auto;
margin-bottom: 100px;
}
.title-text h1{
text-align: center;
margin-bottom: 35px;
font-size: 2.75rem;
}
.title-text p{
text-align: center;
font-size: 1.25rem;
margin-bottom: 50px;
}
.title-buttons{
margin: auto;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 170px;
}
.download-ios button,
.download-mac button{
display: inline;
margin-right: 20px;
height: 50px;
width: 225px;
border-radius: 30px;
outline: none;
border: none;
font-size: 18px;
color: #fff;
padding: 10px 20px;
transition: 0.2s;
}
.download-ios button{
background-color: #26bba5;
border-bottom: 3px solid #18a08c;
}
.download-mac button{
background-color: #6174ff;
border-bottom: 3px solid #5362d7;
}
.computer-div{
margin-top: 500px;
position: relative;
}
.computer-image img{
display: inline;
margin-left: -30px;
width: 900px;
margin-bottom: 100px;
}
.all-searches-container{
position: absolute;
top: 50px;
right: 265px;
}
.search-div{
width: 350px;
}
.search-div h1{
margin-bottom: 15px;
}
.search-div p{
margin-bottom: 50px;
}
.title-img{
margin: auto;
display: flex;
justify-content: center;
align-items: center;
margin-top: 100px;
margin-bottom: 100px;
}
.sections{
position: relative;
display: inline;
margin-top: 200px;
margin-bottom: 200px;
}
.section{
display: inline;
width: 300px;
margin-right: 50px;
}
section h1,
.section p{
text-align: center;
width: 300px;
}
.section h1{
margin-bottom: 15px;
}
.section p{
margin-bottom: 20px;
}
.first h1,
.third h1{
padding-left: 40px;
}
.img-div{
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20px;
}
/*.first{
position: absolute;
top: 50%;
left: -25%;
transform: translate(-25%, -50%);
}
.second{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.third{
position: absolute;
top: 50%;
left: 100%;
transform: translate(-25%, -50%);
}*/
.web-sites{
margin: auto;
margin-top: 1300px;
width: 100%;
padding-left: 200px;
margin-bottom: 150px;
}
.web-site{
display: inline-block;
width: 100px;
margin-right: 190px;
}
.download-ios :hover{
background-color: #5dccbb;
}
.download-mac :hover{
background-color: #8896ff;
}
.footer{
background-color: #f5f6f8;
padding: 25px 150px 20px 150px;
position: relative;
height: 100%;
}
.footer div,
.footer ul{
display: inline-block;
}
.logo-footer{
height: 100%;
width: 300px;
}
.logo-footer img{
width: 50px;
height: 50px;
}
ul{
list-style: none;
display: inline;
margin-top: 30px;
width: 200px;
}
li{
margin-right: 50px;
margin-bottom: 40px;
transition: 0.2s;
}
.social-media{
position: absolute;
right: 150px;
top: 100px;
}
ul :hover{
color: #33b295;
cursor: pointer;
}
.media-icon{
margin-right: 30px;
}
.media-icon svg :hover{
fill: #33b295;
}
#media screen and (max-width:600px){
.title, .computer-image img, .search-div{
width: 100%;
}
.section{
display: block;
top: 50%;
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Bai+Jamjuree:wght#400;600&display=swap" rel="stylesheet">
<title>Clipboard</title>
</head>
<body>
<div class="header">
<div class="logo">
<img src="images/logo.svg" alt="">
</div>
</div>
<div class="main">
<div class="title">
<div class="title-text">
<h1>A history of everything you copy</h1>
<p>Clipboard allows you to track and organize everything you copy.
Instantly acces your clipboard on all your devices.
</p>
</div>
<div class="title-buttons">
<div class="download-ios">
<button>Download for iOS</button>
</div>
<div class="download-mac">
<button>Download for Mac</button>
</div>
</div>
<div class="title-text">
<h1>Keep track of your snippets</h1>
<p>Clipboard instantly stores any item you copy in the cloud,
meaning you can acces your snippets immediatly on all your devices.
Our Mac and iOS apps will help you organize everything.
</p>
</div>
</div>
<div class="computer-div">
<div class="computer-image">
<img src="images/image-computer.png" alt="">
</div>
<div class="all-searches-container">
<div class="search-div">
<h1>Quick Search</h1>
<p>Easily search your snippets by content,
category, web address, application, and more.
</p>
</div>
<div class="search-div">
<h1>iCLoud Sync</h1>
<p>Instantly saves and syncs snippets across all your devices.</p>
</div>
<div class="search-div">
<h1>Complete History</h1>
<p>Retrive any snippets from the first moment you started using app.</p>
</div>
</div>
<div class="title">
<div class="title-text">
<h1>Acces clipboard anywhere</h1>
<p>Whether you're on the go, or at your computer,
you can acces all your Clipboard snippets in a
few simple clicks.
</p>
</div>
<div class="title-img">
<img src="images/image-devices.png" alt="">
</div>
<div class="title-text">
<h1>Supercharge your workflow</h1>
<p>We've got tools to boost your productivity.</p>
</div>
<div class="sections">
<div class="section first">
<img src="images/icon-blacklist.svg" alt="">
<h1>Create blacklists</h1>
<p>Ensure sensitivite information never
makes its way to your clipboard by excluding
certain sources.
</p>
</div>
<div class="section second">
<img src="images//icon-text.svg" alt="">
<h1>Plain text snippets</h1>
<p>Remove unwanted formatting from copied
text for a consistent look.
</p>
</div>
<div class="section third">
<img src="images/icon-preview.svg" alt="">
<h1>Sneak preview</h1>
<p>Quick preview of all snippets on your Clipboard
for easy acces.
</p>
</div>
</div>
</div>
<div class="web-sites">
<div class="web-site">
<img src="images/logo-google.png" alt="">
</div>
<div class="web-site">
<img src="images/logo-ibm.png" alt="">
</div>
<div class="web-site">
<img src="images/logo-microsoft.png" alt="">
</div>
<div class="web-site">
<img src="images/logo-hp.png" alt="">
</div>
<div class="web-site">
<img src="images/logo-vector-graphics.png" alt="">
</div>
</div>
</div>
<div class="title">
<div class="title-text">
<h1>Clipboard for iOS and Mac OS</h1>
<p>Avaible for free on App Store. Download for Mac or iOS, sync
with iCloud and you're ready to start adding to your clipboard.
</p>
</div>
<div class="title-buttons">
<div class="download-ios"><button>Download for iOS</button></div>
<div class="download-mac"><button>Download for Mac</button></div>
</div>
</div>
</div>
<div class="footer">
<div class="logo-footer">
<img src="images/logo.svg" alt="">
</div>
<ul>
<li>FAQs</li>
<li>Contact Us</li>
</ul>
<ul>
<li>Privacy Policy</li>
<li>Press Kit</li>
</ul>
<ul>
<li>Install Guide</li>
</ul>
<div class="social-media">
<div class="media-icon">
<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg"><path d="M22.675 0H1.325C.593 0 0 .593 0 1.325v21.351C0 23.407.593 24 1.325 24H12.82v-9.294H9.692v-3.622h3.128V8.413c0-3.1 1.893-4.788 4.659-4.788 1.325 0 2.463.099 2.795.143v3.24l-1.918.001c-1.504 0-1.795.715-1.795 1.763v2.313h3.587l-.467 3.622h-3.12V24h6.116c.73 0 1.323-.593 1.323-1.325V1.325C24 .593 23.407 0 22.675 0z" fill="#4C545C" fill-rule="nonzero"/></svg> </div>
<div class="media-icon">
<svg width="24" height="20" xmlns="http://www.w3.org/2000/svg"><path d="M24 2.557a9.83 9.83 0 01-2.828.775A4.932 4.932 0 0023.337.608a9.864 9.864 0 01-3.127 1.195A4.916 4.916 0 0016.616.248c-3.179 0-5.515 2.966-4.797 6.045A13.978 13.978 0 011.671 1.149a4.93 4.93 0 001.523 6.574 4.903 4.903 0 01-2.229-.616c-.054 2.281 1.581 4.415 3.949 4.89a4.935 4.935 0 01-2.224.084 4.928 4.928 0 004.6 3.419A9.9 9.9 0 010 17.54a13.94 13.94 0 007.548 2.212c9.142 0 14.307-7.721 13.995-14.646A10.025 10.025 0 0024 2.557z" fill="#4C545C" fill-rule="nonzero"/></svg> </div>
<div class="media-icon">
<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z" fill="#4C545C" fill-rule="nonzero"/></svg>
</div>
</div>
</div>
</body>
</html>
I tried to change something, that is why my css looks incomplete.
The box-sizing CSS property sets how the total width and height of an element is calculated.
Try setting all elements box-sizing default to border-box like this:
*{
box-sizing: border-box;
}
body{
width: 100vw!important;
}
Here is a full example:
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body{
font-family: 'Bai Jamjuree', sans-serif;
min-width: 100vw;
width: 100vw!important;
max-width: 100vw;
}
h1{
color: #535a62;
}
p{
font-weight: 600;
color: #a6a7a9;
}
.header{
background: url("https://via.placeholder.com/1200");
background-size: cover;
height: 300px;
padding: 130px 0 0 0;
}
.logo{
margin: auto;
width: 125px;
height: 125px;
}
.title{
width: 690px;
height: 225px;
margin: auto;
margin-bottom: 100px;
}
.title-text h1{
text-align: center;
margin-bottom: 35px;
font-size: 2.75rem;
}
.title-text p{
text-align: center;
font-size: 1.25rem;
margin-bottom: 50px;
}
.title-buttons{
margin: auto;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 170px;
}
.download-ios button,
.download-mac button{
display: inline;
margin-right: 20px;
height: 50px;
width: 225px;
border-radius: 30px;
outline: none;
border: none;
font-size: 18px;
color: #fff;
padding: 10px 20px;
transition: 0.2s;
}
.download-ios button{
background-color: #26bba5;
border-bottom: 3px solid #18a08c;
}
.download-mac button{
background-color: #6174ff;
border-bottom: 3px solid #5362d7;
}
.computer-div{
margin-top: 500px;
position: relative;
}
.computer-image img{
display: inline;
margin-left: -30px;
width: 900px;
margin-bottom: 100px;
}
.all-searches-container{
position: absolute;
top: 50px;
right: 265px;
}
.search-div{
width: 350px;
}
.search-div h1{
margin-bottom: 15px;
}
.search-div p{
margin-bottom: 50px;
}
.title-img{
margin: auto;
display: flex;
justify-content: center;
align-items: center;
margin-top: 100px;
margin-bottom: 100px;
}
.sections{
position: relative;
display: inline;
margin-top: 200px;
margin-bottom: 200px;
}
.section{
display: inline;
width: 300px;
margin-right: 50px;
}
section h1,
.section p{
text-align: center;
width: 300px;
}
.section h1{
margin-bottom: 15px;
}
.section p{
margin-bottom: 20px;
}
.first h1,
.third h1{
padding-left: 40px;
}
.img-div{
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20px;
}
/*.first{
position: absolute;
top: 50%;
left: -25%;
transform: translate(-25%, -50%);
}
.second{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.third{
position: absolute;
top: 50%;
left: 100%;
transform: translate(-25%, -50%);
}*/
.web-sites{
margin: auto;
margin-top: 1300px;
width: 100%;
padding-left: 200px;
margin-bottom: 150px;
}
.web-site{
display: inline-block;
width: 100px;
margin-right: 190px;
}
.download-ios :hover{
background-color: #5dccbb;
}
.download-mac :hover{
background-color: #8896ff;
}
.footer{
background-color: #f5f6f8;
padding: 25px 150px 20px 150px;
position: relative;
height: 100%;
}
.footer div,
.footer ul{
display: inline-block;
}
.logo-footer{
height: 100%;
width: 300px;
}
.logo-footer img{
width: 50px;
height: 50px;
}
ul{
list-style: none;
display: inline;
margin-top: 30px;
width: 200px;
}
li{
margin-right: 50px;
margin-bottom: 40px;
transition: 0.2s;
}
.social-media{
position: absolute;
right: 150px;
top: 100px;
}
ul :hover{
color: #33b295;
cursor: pointer;
}
.media-icon{
margin-right: 30px;
}
.media-icon svg :hover{
fill: #33b295;
}
#media screen and (max-width:600px){
.title, .computer-image img, .search-div{
width: 100%;
}
.section{
display: block;
top: 50%;
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Bai+Jamjuree:wght#400;600&display=swap" rel="stylesheet">
<title>Clipboard</title>
</head>
<body>
<div class="header">
<div class="logo">
<img src="images/logo.svg" alt="">
</div>
</div>
<div class="main">
<div class="title">
<div class="title-text">
<h1>A history of everything you copy</h1>
<p>Clipboard allows you to track and organize everything you copy.
Instantly acces your clipboard on all your devices.
</p>
</div>
<div class="title-buttons">
<div class="download-ios">
<button>Download for iOS</button>
</div>
<div class="download-mac">
<button>Download for Mac</button>
</div>
</div>
<div class="title-text">
<h1>Keep track of your snippets</h1>
<p>Clipboard instantly stores any item you copy in the cloud,
meaning you can acces your snippets immediatly on all your devices.
Our Mac and iOS apps will help you organize everything.
</p>
</div>
</div>
<div class="computer-div">
<div class="computer-image">
<img src="images/image-computer.png" alt="">
</div>
<div class="all-searches-container">
<div class="search-div">
<h1>Quick Search</h1>
<p>Easily search your snippets by content,
category, web address, application, and more.
</p>
</div>
<div class="search-div">
<h1>iCLoud Sync</h1>
<p>Instantly saves and syncs snippets across all your devices.</p>
</div>
<div class="search-div">
<h1>Complete History</h1>
<p>Retrive any snippets from the first moment you started using app.</p>
</div>
</div>
<div class="title">
<div class="title-text">
<h1>Acces clipboard anywhere</h1>
<p>Whether you're on the go, or at your computer,
you can acces all your Clipboard snippets in a
few simple clicks.
</p>
</div>
<div class="title-img">
<img src="images/image-devices.png" alt="">
</div>
<div class="title-text">
<h1>Supercharge your workflow</h1>
<p>We've got tools to boost your productivity.</p>
</div>
<div class="sections">
<div class="section first">
<img src="images/icon-blacklist.svg" alt="">
<h1>Create blacklists</h1>
<p>Ensure sensitivite information never
makes its way to your clipboard by excluding
certain sources.
</p>
</div>
<div class="section second">
<img src="images//icon-text.svg" alt="">
<h1>Plain text snippets</h1>
<p>Remove unwanted formatting from copied
text for a consistent look.
</p>
</div>
<div class="section third">
<img src="images/icon-preview.svg" alt="">
<h1>Sneak preview</h1>
<p>Quick preview of all snippets on your Clipboard
for easy acces.
</p>
</div>
</div>
</div>
<div class="web-sites">
<div class="web-site">
<img src="images/logo-google.png" alt="">
</div>
<div class="web-site">
<img src="images/logo-ibm.png" alt="">
</div>
<div class="web-site">
<img src="images/logo-microsoft.png" alt="">
</div>
<div class="web-site">
<img src="images/logo-hp.png" alt="">
</div>
<div class="web-site">
<img src="images/logo-vector-graphics.png" alt="">
</div>
</div>
</div>
<div class="title">
<div class="title-text">
<h1>Clipboard for iOS and Mac OS</h1>
<p>Avaible for free on App Store. Download for Mac or iOS, sync
with iCloud and you're ready to start adding to your clipboard.
</p>
</div>
<div class="title-buttons">
<div class="download-ios"><button>Download for iOS</button></div>
<div class="download-mac"><button>Download for Mac</button></div>
</div>
</div>
</div>
<div class="footer">
<div class="logo-footer">
<img src="images/logo.svg" alt="">
</div>
<ul>
<li>FAQs</li>
<li>Contact Us</li>
</ul>
<ul>
<li>Privacy Policy</li>
<li>Press Kit</li>
</ul>
<ul>
<li>Install Guide</li>
</ul>
<div class="social-media">
<div class="media-icon">
<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg"><path d="M22.675 0H1.325C.593 0 0 .593 0 1.325v21.351C0 23.407.593 24 1.325 24H12.82v-9.294H9.692v-3.622h3.128V8.413c0-3.1 1.893-4.788 4.659-4.788 1.325 0 2.463.099 2.795.143v3.24l-1.918.001c-1.504 0-1.795.715-1.795 1.763v2.313h3.587l-.467 3.622h-3.12V24h6.116c.73 0 1.323-.593 1.323-1.325V1.325C24 .593 23.407 0 22.675 0z" fill="#4C545C" fill-rule="nonzero"/></svg> </div>
<div class="media-icon">
<svg width="24" height="20" xmlns="http://www.w3.org/2000/svg"><path d="M24 2.557a9.83 9.83 0 01-2.828.775A4.932 4.932 0 0023.337.608a9.864 9.864 0 01-3.127 1.195A4.916 4.916 0 0016.616.248c-3.179 0-5.515 2.966-4.797 6.045A13.978 13.978 0 011.671 1.149a4.93 4.93 0 001.523 6.574 4.903 4.903 0 01-2.229-.616c-.054 2.281 1.581 4.415 3.949 4.89a4.935 4.935 0 01-2.224.084 4.928 4.928 0 004.6 3.419A9.9 9.9 0 010 17.54a13.94 13.94 0 007.548 2.212c9.142 0 14.307-7.721 13.995-14.646A10.025 10.025 0 0024 2.557z" fill="#4C545C" fill-rule="nonzero"/></svg> </div>
<div class="media-icon">
<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z" fill="#4C545C" fill-rule="nonzero"/></svg>
</div>
</div>
</div>
</body>
</html>
I am trying to create a Product catalog. I have planned to create multiple rows whereas in each row there would be 2 products each.
Thus in each row the 1st product belongs to product-1 class and 2nd product belongs to product - 2 class.
I have divided the page vertically into two parts using float:left and specified width:50% for both classes.
And also for product-2 class I have specified left:50% (to push it to left)
I have kept display:block , position:relative for both classes.
But the width property seems to not be working.
Code: https://jsfiddle.net/abhaygc/0pfygcbe/
Code Snippet:
body{
height: 100vh;
margin: 0px;
overflow: scroll;
}
.header{
background-color: white;
height:8%;
overflow: hidden;
font-style: "Roboto";
font-size: 25px;
border-bottom: 2px solid;
border-bottom-color: #cccccc;
}
#clear{
clear: both;
}
.logo{
margin-top: 12px;
float: left;
left: 0px;
padding-right: 50px;
}
#logo:hover{
background: transparent;
}
.links{
display: block;
float: right;
margin-right: 10px;
margin-top: 10px;
}
a{
position: relative;
right: 0px;
/*top: 25px;*/
padding-left: 10px;
padding-right: 10px;
color:black;
letter-spacing: 2px;
font-weight: 200;
text-decoration: none;
}
a:hover{
background-color:#cccccc;
}
.content{
display: block;
background-color: white;
height: 92%;
margin-top: 0px;
}
#clear{
clear: both;
}
.image{
display: block;
width: 200px;
height: 200px;
border-style: dashed;
border-color: red;
border-width: 2px;
overflow: hidden;
}
.product-1{
display: block;
position: relative;
padding-left: 10%;
padding-right: 10%;
margin-top: 5%;
float: left;
left: 0px;
width: 40%;
overflow: hidden;
border-style: solid;
border-color: black;
border-width: 1px;
}
.product-2{
display: block;
position: relative;
padding-left: 10%;
padding-right: 10%;
margin-top: 5%;
float: left;
left: 50%;
width: 50%;
overflow: hidden;
border-style: solid;
border-color: black;
border-width: 1px;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet'>
<link rel="stylesheet" type="text/css" href="products.css">
<title>Products</title>
</head>
<body>
<div class="header">
<div class="logo">
<img id="logo"src="logo.png" alt="LOGO">
</div>
<div class="links">
Home
Products
Login
Register
Contact
About
</div>
</div>
<div class="content">
<div class="product-1 product">
<div class="image">
<img src="slide-4.jpg" alt="Image 1" />
</div>
<div class="caption">
</div>
</div>
<div class="product-2 product">
<div class="image">
<img src="slide-5.jpg" alt="Image 2"/>
</div>
<div class="caption">
</div>
</div>
<div id="clear"></div>
<div class="product-1 product">
<div class="image">
<img src="slide-6.jpg" alt="Image 3"/>
</div>
<div class="caption">
</div>
</div>
<div class="product-2 product">
<div class="image">
<img src="slide-5.jpg" alt="Image 4"/>
</div>
<div class="caption">
</div>
</div>
</div>
</body>
<script type="text/javascript" src="products.js"></script>
</html>
The width in .product-2 does does not visibly work because of the left: 50% property you have assigned to it. If you remove that, then assigning a width to .product-2 will work. I have added a <div class="row"> to each of your division to distinctly divide them as a row. I assigned float-right to .product-2 and a sample width of 200px so you can see the width working. Hope this answers your question, good luck
body{
height: 100vh;
margin: 0px;
overflow: scroll;
}
.header{
background-color: white;
height:8%;
overflow: hidden;
font-style: "Roboto";
font-size: 25px;
border-bottom: 2px solid;
border-bottom-color: #cccccc;
}
#clear{
clear: both;
}
.logo{
margin-top: 12px;
float: left;
left: 0px;
padding-right: 50px;
}
#logo:hover{
background: transparent;
}
.links{
display: block;
float: right;
margin-right: 10px;
margin-top: 10px;
}
a{
position: relative;
right: 0px;
/*top: 25px;*/
padding-left: 10px;
padding-right: 10px;
color:black;
letter-spacing: 2px;
font-weight: 200;
text-decoration: none;
}
a:hover{
background-color:#cccccc;
}
.content{
display: block;
background-color: white;
height: 92%;
margin-top: 0px;
}
#clear{
clear: both;
}
.image{
display: block;
width: 200px;
height: 200px;
border-style: dashed;
border-color: red;
border-width: 2px;
overflow: hidden;
}
.product-1{
display: block;
position: relative;
padding-left: 10%;
padding-right: 10%;
margin-top: 5%;
float: left;
left: 0px;
width: 175px; /* sample width */
overflow: hidden;
border-style: solid;
border-color: black;
border-width: 1px;
}
.product-2{
display: block;
position: relative;
padding-left: 10%;
padding-right: 10%;
margin-top: 5%;
float: right;
width: 175px; /* sample width */
overflow: hidden;
border-style: solid;
border-color: black;
border-width: 1px;
}
<body>
<div class="header">
<div class="logo">
<img id="logo"src="logo.png" alt="LOGO">
</div>
<div class="links">
Home
Products
Login
Register
Contact
About
</div>
</div>
<div class="content">
<div class="row">
<div class="product-1 product">
<div class="image">
<img src="slide-4.jpg" alt="Image 1" />
</div>
<div class="caption">
</div>
</div>
<div class="product-2 product">
<div class="image">
<img src="slide-5.jpg" alt="Image 2"/>
</div>
<div class="caption">
</div>
</div>
</div>
<div id="clear"></div>
<div class="row">
<div class="product-1 product">
<div class="image">
<img src="slide-6.jpg" alt="Image 3"/>
</div>
<div class="caption">
</div>
</div>
<div class="product-2 product">
<div class="image">
<img src="slide-5.jpg" alt="Image 4"/>
</div>
<div class="caption">
</div>
</div>
</div>
</div>
</body>
body{
height: 100vh;
margin: 0px;
overflow: scroll;
}
.header{
background-color: white;
height:8%;
overflow: hidden;
font-style: "Roboto";
font-size: 25px;
border-bottom: 2px solid;
border-bottom-color: #cccccc;
}
#clear{
clear: both;
}
.logo{
margin-top: 12px;
float: left;
left: 0px;
padding-right: 50px;
}
#logo:hover{
background: transparent;
}
.links{
display: block;
float: right;
margin-right: 10px;
margin-top: 10px;
}
a{
position: relative;
right: 0px;
/*top: 25px;*/
padding-left: 10px;
padding-right: 10px;
color:black;
letter-spacing: 2px;
font-weight: 200;
text-decoration: none;
}
a:hover{
background-color:#cccccc;
}
.content{
display: block;
background-color: white;
height: 92%;
margin-top: 0px;
}
#clear{
clear: both;
}
.image{
display: block;
width: 200px;
height: 200px;
border-style: dashed;
border-color: red;
border-width: 2px;
overflow: hidden;
margin: 0 auto;
}
.product-1{
display: block;
position: relative;
/* padding-left: 10%; */
/* padding-right: 10%; */
margin-top: 5%;
float: left;
/* left: 0px; */
width: 40%;
overflow: hidden;
border-style: solid;
border-color: black;
border-width: 0;
margin: 0 5%;
margin-top: 15px;
box-sizing: border-box;
border-width:1px;
}
.product-2{
display: block;
position: relative;
/* padding-left: 10%; */
/* padding-right: 10%; */
/* margin-top: 15px; */
float: left;
/* left: 50%; */
width: 40%;
overflow: hidden;
border-style: solid;
border-color: black;
border-width: 0;
margin: 0 5%;
margin-top: 15px;
box-sizing: border-box;
border-width:1px;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet'>
<link rel="stylesheet" type="text/css" href="products.css">
<title>Products</title>
</head>
<body>
<div class="header">
<div class="logo">
<img id="logo"src="logo.png">
</div>
<div class="links">
Home
Products
Login
Register
Contact
About
</div>
</div>
<div class="content">
<div class="product-1 product">
<div class="image">
<img src="slide-4.jpg" alt="Image 1" />
</div>
<div class="caption">
</div>
</div>
<div class="product-2 product">
<div class="image">
<img src="slide-5.jpg" alt="Image 2"/>
</div>
<div class="caption">
</div>
</div>
<div id="clear"></div>
<div class="product-1 product">
<div class="image">
<img src="slide-6.jpg" alt="Image 3"/>
</div>
<div class="caption">
</div>
</div>
<div class="product-2 product">
<div class="image">
<img src="slide-5.jpg" alt="Image 4"/>
</div>
<div class="caption">
</div>
</div>
</div>
</body>
<script type="text/javascript" src="products.js"></script>
</html>
https://jsfiddle.net/Sampath_Madhuranga/0pfygcbe/23/
This works fine. Let me know if there is any problem.
Thanks
I face some problem in my html and css.
My requirement like this image:-
My code below:-
#font-face {
font-family: "OpenSans-CondLight";
src: url('fonts/OpenSans-CondLight.woff') format('woff');
}
#font-face {
font-family: "Rubik-BoldItalic";
src: url('fonts/Rubik-BoldItalic.woff') format('woff');
}
#font-face {
font-family: "RobotoSlab-Regular";
src: url('fonts/RobotoSlab-Regular.woff') format('woff');
}
/*header area */
header{
height: 350px;
background: #050000;
overflow: hidden;
display: block;
}
.container{
background: #050000;
}
.top-area{
float: left;
width: 20%;
font-family: "Rubik-BoldItalic";
font-size: 60px;
color: #FFFFFF;
text-transform: uppercase;
overflow: hidden;
}
.logo-area {
width: 60%;
overflow: hidden;
display: block;
position: relative;
z-index: 9999;
}
.logo-area img {
width: 500px;
height: auto;
z-index: 9999;
margin-left: 35px;
}
.search-box {
width: 25%;
float: right;
margin: -300px 73px 0 0;
}
.all-events {
overflow: hidden;
background: #FF9D34;
height: 100px;
width: 80%;
margin: auto;
display: block;
position: absolute;
top: 178px;
border-radius: 10px;
z-index: 0;
}
.all-events .left-side span{
float: left;
color: #000000;
text-transform: uppercase;
font-size: 25px;
padding-left: 20px;
padding-top: 40px;
}
.all-events .left-side .glyphicon {
font-size: 45px;
color: #000;
}
.all-events .right-side span{
float: right;
color: #000000;
text-transform: uppercase;
font-size: 25px;
}
.main-content {
width: 100%;
height: 100%;
overflow: hidden;
display: block;
background: #FF931D;
margin: auto;
}
.main-content .left-content .top-content{
float: left;
overflow: hidden;
display: block;
width: 55%;
height: 340px;
margin-top: 22px;
}
.main-content .left-content .top-content img {
width: 600px;
height: 300px;
}
.main-content .left-content .bottom-content{
float: left;
overflow: hidden;
display: block;
width: 75%;
height: 340px;
margin-top: 10px;
}
.main-content .left-content .bottom-content img {
width: 600px;
height: 300px;
}
.main-content .right-content {
float: right;
overflow: hidden;
display: block;
width: 40%;
margin: -688px 52px 0 0;
}
.main-content .right-content img {
width: 522px;
height: 648px;
}
footer{
overflow: hidden;
display: block;
height: 410px;
width: 90%;
margin: auto;
background-color: #FF931D;
}
footer .left-footer {
float: left;
width: 350px;
overflow: hidden;
display: block;
}
footer .middle-footer {
width: 350px;
overflow: hidden;
display: block;
}
.about {
height: 400px;
width: 400px;
border-radius: 50%;
background: #fff;
float: right;
position: relative;
top: -79px;
}
.about p {
position: absolute;
font-family: "OpenSans-CondLight";
font-size: 25px;
text-align: center;
top: 62px;
}
.about img {
width: 80px;
height: auto;
position: relative;
top: 240px;
left: 98px;
margin-left: 31px;
}
.button {
font-size: 15px;
color: blue;
cursor: pointer;
}
.button:active{
color: #000;
}
.caption {
background: #fff;
width: 599px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta content="IE=edge">
<title>Spotlight</title>
<!-- style -->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<link rel="stylesheet" type="text/css" href="css/normalize.css" media="all" />
<link rel="stylesheet" type="text/css" href="style.css" media="all">
<!-- js -->
<link rel="stylesheet" type="text/css" href="js/modernizr.js" media="all" />
</head>
<body>
<header>
<div class="container">
<div class="top-area">
<h2>24 hour event</h2>
</div>
<div class="logo-area">
<img src="images/logo.gif" alt="Logo">
</div>
<div class="search-box">
<div class="row">
<div class="input-group">
<span class="input-group-btn">
<button class="btn btn-default" type="button"><span class="glyphicon glyphicon-search"></span></button>
</span>
<input type="text" class="form-control" placeholder="Search for...">
</div>
</div>
</div>
<div class="all-events">
<div class="left-side">
<span>donate here</span>
<div class="donate_img">
<img src="images/07.tif" alt="">
</div>
</div>
<div class="right-side">
<span>all events faq</span>
</div>
</div>
</div>
</header>
<section class="main-content">
<div class="container">
<div class="left-content">
<div class="top-content">
<img src="images/damien-rice-tour-italia.jpg" alt="">
<div class="caption">
<span>Damien Rice, Kildare Culture Centre at 8pm. Ref: DMK</span>
<div class="button">
Book now
</div>
</div>
</div>
<div class="bottom-content">
<img src="images/glenhansard_100x445.jpg" alt="">
<div class="caption">
<span>Glen Hansard, Olympia Theatre Dublin at 7pm. Ref: GHO </span>
<div class="button">Book now
</div>
</div>
</div>
</div>
<div class="right-content">
<img src="images/tommytiernan.jpg" alt="">
<div class="caption">
<span>Tommy Tiernan, Cork Comedy Club at 7pm. Ref: GHO</span>
<div class="button">Book now
</div>
</div>
</div>
</div>
</section>
<footer>
<div class="container">
<div class="left-footer">
<span>Click on the blue <div class="button">Book now</div> now link on any
event enter your email and you will recive your
ticket via email.
Alternativly or if you have any questions not
listed on the faq tab you can book your tocket
dierectly with us qouting the event refrence
number.
</span>
</div>
<div class="middle-footer">
<span>phone:0741237451
email:24hourevent#spotlight.ie
get involved
Would you like to volunteer even one
hour of your time. Make a diffrence
contact us at:
volunteer#spotlight.ie
</span>
</div>
<div class="about">
<p>ABOUT <br>
Focas Ireland works with
people who are homeless or
who are at risk of losing there
homes across ireland.
<br> Focas Ireland website click </p>
<img src="images/d2c4efe596a6d313c1005ff33ff627ff.jpeg" alt="focus">
<img src="images/here_fixed_wm.jpg" alt="download">
</div>
<div class="social-icons">
<img src="images/youtube heart shaped free social media icon .png" alt="you tube">
<img src="images/Facebook heart shaped free social media icon.png" alt="facebook">
<img src="images/twitter heart shaped free social media icon.png" alt="twitter">
</div>
</div>
</footer>
</body>
</html>
My main problem is in my footer I can't change the color. Image bottom side. Can anyone help me?
You can try adding this line of CSS:
footer:after {
content: "";
display: table;
clear: both;
}
in the below code the top property inside the id "#bad" is does not make any effect, can any one help me. it's made some effect when i used it with
some other codes.
html code :
<html>
<head>
<link rel="stylesheet" type="text/css" href="rise.css">
</head>
<body>
<div id="good">
<div id="vahid">
<div id="one">
<img src="image1.jpg" id="boom"><br><br><br><br><br>
<!--button-->
<img src="button.jpg" id="button"><br><br><br><br>
<!--icons-->
<span class="local">
<img src="img.jpg">
<img src="img1.jpg">
<img src="img2.jpg">
<img src="img3.jpg">
</span><br><br><br><br>
<span class="local">
<img src="img4.jpg">
<img src="img5.jpg">
<img src="img6.jpg">
<img src="img7.jpg">
</span>
</div>
</div>
<div id="isnani">
<div id="third">
<p >
<span class="fourth">Dashboard</span>
<span class="fifth"> + New</span>
</p>
<!--<p class="fourth"> </p>
<p id="fort"><input type="text" placeholder="search your project here..." ></p>
<div id="jump"><img src="search.jpg" height="20px" width="10px"></div>-->
<p id="sixth"> Welcome to Flatkit</p>
<p id="seventh"> Bootstrap 4 Web App Kit With Angular js</p>
</div>
</div>
</div>
<div id="bad">
</div>
</body>
</html>
css :
#good{
width: 100%;
height: 100%;
}
#bad{
width: 15%;
height: 100%;
background-color: #023b3b;
top:-80%;
}
#vahid{
float: left;
width: 7%;
height: 100%;
background-color: #023b3b;
}
#isnani{
float: left;
width: 93%;
height: 100%;
background-color: bisque;
}
#one {
display:block;
background-color: #023b3b;
/* width:60px;
height: 867px;*/
}
#boom{
margin-top: 30%;
height: 5%;
width: 35%;
float: left;
padding-left: 20px;
}
.local img {
height: 2.5%;
width:30%;
margin :10px 0px 10px 20px;
}
/*isnani starts here*/
#third{ float:left;
width:100%;
height: 15%;
border-color:white;
border-style : solid;
background-color : white;
}
.fourth{
margin-left: 2%;
margin-top: 5%;
font-family: sans-serif;
}
.fifth{
color: #808080;
font-size: 80%;
font-weight: 800;
font-family: arial,sans-serif;
margin-left: 1%;
}
#sixth{
font-family: sans-serif;
font-size:150%;
color:#666666;
margin-top: 4%;
margin-left: 2%;
/*top: -2%;/
/* line-height: 3%; */
}
#seventh{
position: absolute;
top: 11%;
color: #808080;
font-family: sans-serif;
font-size: 80%;
margin-left: 1.8%;
margin-top: 1.5%;
/*line-height: 3%;*/
}
#fort{
float: right;
margin-top: -65px;
margin-right: 80px;
}
#button{
margin-left: 80%;
width: 20%;
hyphens: 20%;
}
in the above code the top property inside the id "#bad" is does not make any effect, can any one help me. it's made some effect when i used it with
some other codes.
For properties top/bottom/left/right to take effect element must be positioned non-statically - have position relative/absolute/fixed.
Apply position to your #bad