Related
Hi i'm a begginer at html and css and i know my code is really bad. I want to make my website visitable on any device here's a demo. I can't figure out how to do the responsive design i can't get it to work. here's the site.View it in light mode because some pictures are not transparent. http://computerstoremk.000webhostapp.com/
Here's all the html and css code.
Sorry for the mess. If anyone could tell me how to scale it down when sizing down the browser size so it could be readable on any device let me know. If you can find the simplest ways it would be nice.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="HandheldFriendly" content="true">
<link rel="stylesheet" type="text/css" href="style.css">
<title>Computer Store MK</title>
</head>
<body>
<section class="section">
<nav id="nav">
<div>
<ul>
<li>Home</li>
<li>Shops</li>
<li>About</li>
<li>Contact</li>
</ul>
</div>
<h3>PC Configurations</h3>
<p id="store">Computer Store MK</p>
</nav>
<br>
<br>
<br>
<br>
<br>
<h2>Personal Computers</h2>
<br>
<br>
<br>
<br>
<br>
<img src="https://www.pbtech.co.nz/imgprod/W/K/WKSGGPC51151__1.jpg" id="PC1">
<p id="pc1spec"><b>Titan Gaming PC</b> <br>Specs:<br>Ryzen 5 5600x<br>GTX 1080 TI<br>16 GB DDR4 2666mhz Ram</p>
<img src="https://vrlatech.com/wp-content/uploads/2019/11/Helios.png" id="PC2">
<p id="pc2spec"><b>Helios Gaming PC</b><br>Specs:<br>Intel Core I7 10700K<br>GTX 1080<br>16GB DDR4 3200mhz Ram</p>
<img src="https://plecom.imgix.net/iil-259648-646963.jpg?auto=format&w=600&h=600" id="PC3">
<p id="pc3spec"><b>Corssair</b><br>Specs:<br>Ryzen 7 5800x<br>Radeon RX 6700XT<br>24GB DDR4 4000mhz Ram</p>
Order Now
Order Now
Order Now
<img src="https://www.corsair.com/medias/sys_master/images/images/h3e/h94/9618136924190/CS-9050008-NA/Gallery/Vengeance_A7200_01/-CS-9050008-NA-Gallery-Vengeance-A7200-01.png_515Wx515H" id="PC4">
<p id="pc4spec"><b>Vengeance Gaming PC</b><br>Specs:<br>RTX 2080 SUPER<br>Intel Core I9 10900K<br>32GB DDR4 3600mhz Ram</p>
Order Now
Order Now
Order Now
<img src="https://www.pcdiy.com.au/wp-content/uploads/2021/03/asus_tuf_gaming_gt301_rgb_tempered_glass_midtower_atx_case_ac34039-600x600-1.jpg" id="PC5">
<p id="pc5spec"><b>Cezzane Gaming Pc</b><br>Specs:<br>Radeon 6600 XT<br>Intel Core I7 11700K<br>24GB DDR4 3200mhz Ram</p>
<img src="https://www.cclonline.com/images/avante/ccl-horizon-cit-flash-main-image.jpg?width=600&height=600&scale=canvas" id="PC6">
<p id="pc6spec"><b>Horizon Gaming PC</b><br>Specs:<br>RTX 3060 TI<br>Ryzen 9 3650x<br>64GB DDR4 4000mhz Ram</p>
</section>
</body>
</html>
#import url('http://fonts.cdnfonts.com/css/segoe-ui-variable');
*{
margin: 0 ;
padding: 0;
}
html,body {
width: 100%;
height:100%;
margin: 0;
padding: 0;
overflow-x: hidden;
}
body{
font-family: 'Segoe UI Variable', sans-serif;
background-color: white;
}
.home{
text-decoration: none;
color: white;
}
.home:hover{
transition: 1s;
text-shadow: 3px 3px red;
}
header{
background-size: cover;
background-position: center;
z-index: 1;
}
h2{
padding: 0px 790px;
font-size: 30px;
font-weight: bolder;
color: #2f3638;
text-shadow: 0 1px 0 #CCCCCC, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 10px 10px rgba(0,0,0,.2), 0 20px 20px rgba(0,0,0,.15);
}
nav{
width: 100%;
height: 75px;
background-color: #273a63;
line-height: 75px;
padding: 0px -15px;
}
h3 {
float: left;
left: 30px;
color: white;
font-size: 30px;
color: #e0dfdc;
position: relative;
text-shadow: 0 -1px 0 #fff, 0 1px 0 #2e2e2e, 0 2px 0 #2c2c2c, 0 3px 0 #2a2a2a, 0 4px 0 #282828, 0 5px 0 #262626, 0 6px 0 #242424, 0 7px 0 #222, 0 8px 0 #202020, 0 9px 0 #1e1e1e, 0 10px 0 #1c1c1c, 0 11px 0 #1a1a1a, 0 12px 0 #181818, 0 13px 0 #161616, 0 14px 0 #141414, 0 15px 0 #121212, 0 22px 30px rgba(0,0,0,0.9);
}
nav ul{
float: right;
}
nav ul li{
display: inline-block;
list-style: none;
}
nav ul li a{
color: #Fff;
font-size: 18px;
text-transform: uppercase;
padding: 0px 32px;
}
#PC1{
width: 400px;
height: 400px;
position: relative;
padding: 0px 150px;
}
#pc1spec{
padding: 0px 270px;
font-size: 25px;
}
#PC2{
width: 400px;
height: 400px;
padding: 0px 725px;
position: relative;
top: -570px;
}
#pc2spec{
padding: 0px 820px;
top: -590px;
position: relative;
font-size: 25px;
}
#PC3{
width: 400px;
height: 400px;
padding: 0px 1300px;
top: -1200px;
position: relative;
}
#pc3spec{
position: relative;
font-size: 25px;
left: -200px;
top: -1205px;
float: Right;
}
#section{
position: relative;
padding: 0px 250px;
}
#Order1{
color: black;
text-decoration: none;
border: 3px solid black;
padding: 10px 40px;
margin: 280px;
border-radius: 50px;;
position: relative;
top: -970px;
}
#Order1:hover{
background-color: black;
transition: 0.5s;
color: white;
}
#Order2{
color: black;
text-decoration: none;
border: 3px solid black;
padding: 10px 40px;
margin: 125px;
border-radius: 50px;;
position: relative;
top: -970px;
}
#Order2:hover{
background-color: black;
transition: 0.5s;
color: white;
}
#Order3{
color: black;
text-decoration: none;
border: 3px solid black;
padding: 10px 40px;
float: right;
border-radius: 50px;;
position: relative;
left: -10px;
top: -982px;
}
#Order3:hover{
background-color: black;
transition: 0.5s;
color: white;
}
#store{
font-size: 30px;
font-weight: bolder;
position: relative;
float: right;
top: 0px;
right: 352px;
color: whitesmoke;
}
#PC4{
position: relative;
width: 400px;
height: 400px;
top: -750px;
padding: 0px 150px;
}
#pc4spec{
position: relative;
font-size: 25px;
padding: 0px 235px;
top: -740px;
}
#PC5{
position: relative;
padding: 0px 215px;
top: -1330px;
width: 450px;
height: 450px;
}
#pc5spec{
position: relative;
left: 825px;
top: -1350px;
font-size: 25px;
float: center;
}
#PC6{
width: 450px;
height: 450px;
position: relative;
top: -1950px;
left: -150px;
float: right;
}
#pc6spec{
position: relative;
font-size: 25px;
float: right;
left: 225px;
top: -1510px;
}
#Order4{
color: black;
text-decoration: none;
border: 3px solid black;
padding: 10px 40px;
float: left;
border-radius: 50px;;
position: relative;
left: 270px;
top: -660px;
}
#Order4:hover{
background-color: black;
transition: 0.5s;
color: white;
}
#Order5{
color: black;
text-decoration: none;
border: 3px solid black;
padding: 10px 40px;
float: left;
border-radius: 50px;;
position: relative;
left: 700px;
top: -660px;
}
#Order5:hover{
background-color: black;
transition: 0.5s;
color: white;
}
#Order6{
color: black;
text-decoration: none;
border: 3px solid black;
padding: 10px 40px;
float: left;
border-radius: 50px;;
position: relative;
left: 1120px;
top: -660px;
}
#Order6:hover{
background-color: black;
transition: 0.5s;
color: white;
}
img { max-width: 100%; height: auto; }
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="style2.css">
<title>Computer Store MK</title>
</head>
<body>
<section class="section">
<nav id="nav">
<div>
<ul>
<li>Home</li>
<li>Shops</li>
<li>About</li>
<li>Contact</li>
</ul>
</div>
<h3>Contacts</h3>
<p id="store">Computer Store MK</p>
</nav>
<br>
<br>
<br>
<br>
<br><br>
<br>
<br>
<br>
<br>
<img src="https://cdn.wccftech.com/wp-content/uploads/2020/09/Gmail.png" id="emailimg">
<p id="email">Contact Me Via Buisness Email</p>
<img src="https://media.istockphoto.com/vectors/phone-icon-call-application-symbol-green-round-button-flat-interface-vector-id1250911025?k=20&m=1250911025&s=170667a&w=0&h=1aZJUHR8KVcvWKyVaufUdR8yN_r5VqTCfyGNx8pdOAY=" id="numimg">
<p id="num">Contact Me Via Number</p>
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/e7/Instagram_logo_2016.svg/1024px-Instagram_logo_2016.svg.png" id="insimg">
<p id="ins">Contact Me Via Instagram</p>
#import url('http://fonts.cdnfonts.com/css/segoe-ui-variable');
*{
margin: 0 ;
padding: 0;
}
html,body {
width: 100%;
height:100%;
margin: 0;
padding: 0;
overflow-x: hidden;
overflow-y: hidden;
}
body{
font-family: 'Segoe UI Variable', sans-serif;
}
.home{
text-decoration: none;
color: white;
}
.home:hover{
transition: 1s;
text-shadow: 3px 3px red;
}
header{
background-size: cover;
background-position: center;
z-index: 1;
}
h2{
padding: 0px 790px;
font-size: 30px;
font-weight: bolder;
color: #2f3638;
text-shadow: 0 1px 0 #CCCCCC, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 10px 10px rgba(0,0,0,.2), 0 20px 20px rgba(0,0,0,.15);
}
nav{
width: 100%;
height: 75px;
background-color: #273a63;
line-height: 75px;
padding: 0px -15px;
}
h3 {
float: left;
left: 30px;
color: white;
font-size: 30px;
color: #e0dfdc;
position: relative;
text-shadow: 0 -1px 0 #fff, 0 1px 0 #2e2e2e, 0 2px 0 #2c2c2c, 0 3px 0 #2a2a2a, 0 4px 0 #282828, 0 5px 0 #262626, 0 6px 0 #242424, 0 7px 0 #222, 0 8px 0 #202020, 0 9px 0 #1e1e1e, 0 10px 0 #1c1c1c, 0 11px 0 #1a1a1a, 0 12px 0 #181818, 0 13px 0 #161616, 0 14px 0 #141414, 0 15px 0 #121212, 0 22px 30px rgba(0,0,0,0.9);
}
nav ul{
float: right;
}
nav ul li{
display: inline-block;
list-style: none;
}
nav ul li a{
color: #Fff;
font-size: 18px;
text-transform: uppercase;
padding: 0px 32px;
}
#store{
font-size: 30px;
font-weight: bolder;
position: relative;
float: right;
top: 0px;
right: 352px;
color: whitesmoke;
}
#email{
position: relative;
font-size: 35px;
top: -102px;
left: 122px;
}
#emailimg{
position: relative;
width: 640px;
height: 400px;
top: -75px;
left: 40px;
}
#numimg{
position: relative;
width: 330px;
height: 330px;
top: -495px;
left: 780px;}
#num{
position: relative;
font-size: 35px;
left: 780px;
top: -480px;
}
#insimg{
position: relative;
width: 230px;
height: 230px;
top: -816px;
left: 1400px;
}
#ins{
position: relative;
font-size: 35px;
top: -760px;
left: 1315px;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="style3.css">
<title>Computer Store MK</title>
</head>
<body>
<section class="section">
<nav id="nav">
<div>
<ul>
<li>Home</li>
<li>Shops</li>
<li>About</li>
<li>Contact</li>
</ul>
</div>
<h3>About Section</h3>
<p id="store">Computer Store MK</p>
</nav>
<p id="about"> Computer Store MK is a Computer Store in North Macedonia Running Since 2004 Where We Sell:<br>Computers, parts, accessories. CSMK Is The Most Relaible Computer Store Out There.<br> We Have The Latest and Greatest Components And The Cheapest Prices Of Any Other Store.<br><br><b id="porder">So Order Now!</b></p>
Order a PC!
<p id="copyr">©Computer Store MK 2022.</p>
#import url('http://fonts.cdnfonts.com/css/segoe-ui-variable');
*{
margin: 0 ;
padding: 0;
}
html,body {
width: 100%;
height:100%;
margin: 0;
padding: 0;
overflow-x: hidden;
overflow-y: hidden;
}
body{
font-family: 'Segoe UI Variable', sans-serif;
}
.home{
text-decoration: none;
color: white;
}
.home:hover{
transition: 1s;
text-shadow: 3px 3px red;
}
header{
background-size: cover;
background-position: center;
z-index: 1;
}
h2{
padding: 0px 790px;
font-size: 30px;
font-weight: bolder;
color: #2f3638;
text-shadow: 0 1px 0 #CCCCCC, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 10px 10px rgba(0,0,0,.2), 0 20px 20px rgba(0,0,0,.15);
}
nav{
width: 100%;
height: 75px;
background-color: #273a63;
line-height: 75px;
padding: 0px -15px;
}
h3 {
float: left;
left: 30px;
color: white;
font-size: 30px;
color: #e0dfdc;
position: relative;
text-shadow: 0 -1px 0 #fff, 0 1px 0 #2e2e2e, 0 2px 0 #2c2c2c, 0 3px 0 #2a2a2a, 0 4px 0 #282828, 0 5px 0 #262626, 0 6px 0 #242424, 0 7px 0 #222, 0 8px 0 #202020, 0 9px 0 #1e1e1e, 0 10px 0 #1c1c1c, 0 11px 0 #1a1a1a, 0 12px 0 #181818, 0 13px 0 #161616, 0 14px 0 #141414, 0 15px 0 #121212, 0 22px 30px rgba(0,0,0,0.9);
}
nav ul{
float: right;
}
nav ul li{
display: inline-block;
list-style: none;
}
nav ul li a{
color: #Fff;
font-size: 18px;
text-transform: uppercase;
padding: 0px 32px;
}
#store{
font-size: 30px;
font-weight: bolder;
position: relative;
float: right;
top: 0px;
right: 352px;
color: whitesmoke;
}
#about{
position: relative;
font-size: 35px;
left: 200px;
top: 200px;
max-width: 100%;
}
#orderpc{
color: black;
text-decoration: none;
border: 5px solid black;
padding: 20px 80px;
float: center;
border-radius: 100px;
position: relative;
top: 310px;
left: 771px;
font-size: 25px;
}
#orderpc:hover{
background-color: black;
transition: 0.5s;
color: white;
}
#porder{
position: relative;
font-size: 35px;
left: 600px;
}
#copyr{
font-size: 30px;
float: right;
left: -20px;
top: 520px;
position: relative;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="style4.css">
<title>Computer Store MK</title>
</head>
<body>
<section class="section">
<nav id="nav">
<div>
<ul>
<li>Home</li>
<li>Shops</li>
<li>About</li>
<li>Contact</li>
</ul>
</div>
<h3>Shop Locations</h3>
<p id="store">Computer Store MK</p>
</nav>
<h2 id="location">Computer Store MK Locations</h2>
<div class="store1">
<hr id="hr">
<p id="skopje"><b>Computer Store MK Skopje</b></p>
<hr id="hr">
<br>
<p id="lc1">street. 1523 бр.1, Скопје<br>
num: 02 3 080 877</p>
<br>
<br>
<p id="sc1"><b>Work Schedule</b><br>Monday to Friday 8:30 to 4:30h<br>Saturday 10:00 to 15:00h<br>Sunday Not Working</p>
</div>
<div class="store2">
<hr id="hr2">
<p id="skopje"><b>Computer Store MK Kavadarci</b></p>
<hr id="hr2">
<br>
<p id="lc1">Западен Булевар бр.2<br>
num: num: 043 447 730</p>
<br>
<br>
<p id="sc2"><b>Work Schedule</b><br>Monday to Friday 09:00 to 21:00h<br>Saturday 09:00 to 20:00h<br>Sunday Not Working</p>
</div>
<div class="store3">
<hr id="hr3">
<p id="skopje"><b>Computer Store Cair</b></p>
<hr id="hr3">
<br>
<p id="lc3">Булевар Македонска Косовска<br> бригада бр.11 1/1<br>num: 02 2 666 036</p>
<br>
<br>
<p id="sc3"><b>Work Schedule</b><br>Monday to Friday 09:00 to 21:00h<br>Saturday 09:00 to 21:00h<br>Sunday 09:00 to 21:00h</p>
</div>
#import url('http://fonts.cdnfonts.com/css/segoe-ui-variable');
*{
margin: 0 ;
padding: 0;
}
html,body {
width: 100%;
height:100%;
margin: 0;
padding: 0;
overflow-x: hidden;
overflow-y: hidden;
}
body{
font-family: 'Segoe UI Variable', sans-serif;
}
.home{
text-decoration: none;
color: white;
}
.home:hover{
transition: 1s;
text-shadow: 3px 3px red;
}
header{
background-size: cover;
background-position: center;
z-index: 1;
}
h2{
padding: 0px 790px;
font-size: 30px;
font-weight: bolder;
color: #2f3638;
text-shadow: 0 1px 0 #CCCCCC, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 10px 10px rgba(0,0,0,.2), 0 20px 20px rgba(0,0,0,.15);
}
nav{
width: 100%;
height: 75px;
background-color: #273a63;
line-height: 75px;
padding: 0px -15px;
}
h3 {
float: left;
left: 30px;
color: white;
font-size: 30px;
color: #e0dfdc;
position: relative;
text-shadow: 0 -1px 0 #fff, 0 1px 0 #2e2e2e, 0 2px 0 #2c2c2c, 0 3px 0 #2a2a2a, 0 4px 0 #282828, 0 5px 0 #262626, 0 6px 0 #242424, 0 7px 0 #222, 0 8px 0 #202020, 0 9px 0 #1e1e1e, 0 10px 0 #1c1c1c, 0 11px 0 #1a1a1a, 0 12px 0 #181818, 0 13px 0 #161616, 0 14px 0 #141414, 0 15px 0 #121212, 0 22px 30px rgba(0,0,0,0.9);
}
nav ul{
float: right;
}
nav ul li{
display: inline-block;
list-style: none;
}
nav ul li a{
color: #Fff;
font-size: 18px;
text-transform: uppercase;
padding: 0px 32px;
}
#store{
font-size: 30px;
font-weight: bolder;
position: relative;
float: right;
top: 0px;
right: 352px;
color: whitesmoke;
}
#location{
font-size: 35px;
font-weight: 700;
position: relative;
left: -765px;
top: 50px;
width: 600px;
}
.store1{
position: relative;
font-size: 30px;
left: 110px;
top: 150px;
}
#hr{
width: 370px;
border: none;
height: 2px;
background-color: #99aed1;
}
#lc1{
font-size: 32px;
}
#sc1{
font-size: 32px;
}
.store2{
position: relative;
font-size: 30px;
left: 765px;
top: -271px;
}
#lc2{
font-size: 32px;
}
#sc2{
font-size: 32px;
}
.store3{
position: relative;
font-size: 30px;
left: 1430px;
top: -691px;
}
#lc3{
font-size: 32px;
}
#sc3{
font-size: 32px;
}
#hr2{
width: 410px;
border: none;
height: 2px;
background-color: #99aed1;
}
#hr3{
width: 290px;
border: none;
height: 2px;
background-color: #99aed1;
}
to answer the question regardless of the code,
how to scale it down when sizing down the browser size
that is done using media queries
, now have a look at this link for better understanding and play with this code to get a better grip
I'm using box-shadow to create internal "border" on left and right. It works great in Chrome or Edge but in Firefox it creates "bottom border" as well. I tried prefixing with -moz- and -webkit- but unsuccessfully.
I don't know how to simulate it in chrome so please run the code in Firefox to see what I am talking about.
Also, it sometimes glitches when zooming in or out in the browser (But zooming in or out in Firefox didn't fix it)
div{
width: 150px;
height: 200px;
box-sizing: border-box;
margin: 0 auto;
background: #001f49;
display: grid;
grid-template-rows: 77% 23%;
align-items: center
}
h1{
color: white;
text-align: center;
text-transform: uppercase;
font-size:18px;
}
span{
background: white;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
position: relative;
box-shadow: inset -1px 0px 0 0 #001f49, inset 1px 0 0 0 #001f49, inset 0 -1px 0 0 #001f49;
-moz-box-shadow: inset -1px 0px 0 0 #001f49, inset 1px 0 0 0 #001f49, inset 0 -1px 0 0 #001f49;
-webkit-box-shadow: inset -1px 0px 0 0 #001f49, inset 1px 0 0 0 #001f49, inset 0 -1px 0 0 #001f49;
}
span::before{
background: inherit;
top: -22px;
content: '';
display: block;
height: 22px;
left: 0;
position: absolute;
right: 0;
transform: skewY(352deg);
transform-origin: 100%;
box-shadow: inset -1px 0px 0 0 #001f49, inset 1px 0 0 0 #001f49;
-moz-box-shadow: inset -1px 0px 0 0 #001f49, inset 1px 0 0 0 #001f49;
-webkit-box-shadow: inset -1px 0px 0 0 #001f49, inset 1px 0 0 0 #001f49;
}
a{
color: #ed174a;
text-decoration: none;
font-weight: bold;
font-size: 18px;
}
<div>
<h1>
Change
</h1>
<span>Pricelist</span>
</div>
I would do the whole thing differently using background and less of code:
div {
width: 150px;
height: 200px;
margin: 0 auto;
border:1px solid #001f49;
background: linear-gradient(-13deg,#0000 33%,#001f49 34%);
display: grid;
grid-template-rows: 77% 1fr;
align-items: center;
text-align: center;
}
h1 {
color: white;
text-transform: uppercase;
font-size: 18px;
}
a {
color: #ed174a;
text-decoration: none;
font-weight: bold;
font-size: 18px;
}
<div>
<h1>
Change
</h1>
<span>Pricelist</span>
</div>
This is working fine with chrome,but box shadow not taking in Mozilla even after adding the browser prefix
h1 {
color: #fff;
font-size: 50px;
background: #101010;
-webkit-box-shadow: 15px 0 #0e0303, -15px 0 #1b0f0f;
-ms-box-shadow: 15px 0 #0e0303, -15px 0 #1b0f0f;
-moz-box-shadow: 15px 0 #0e0303, -15px 0 #1b0f0f;
box-shadow: 15px 0 #0e0303, -15px 0 #1b0f0f;
padding: 0;
line-height: 1.4!important;
display: inline!important;
text-align: justify;
letter-spacing: 4px;
}
<h1>THE <br> SILK <br> ROAD</h1>
Try with box-decoration-break and padding CSS properties. It would be almost helpful to make this effect in a single sentence break.
h1 {
color: #fff;
font-size: 50px;
background: #101010;
line-height: 1.4 !important;
display: inline !important;
text-align: justify;
letter-spacing: 4px;
padding: 0 15px 0 10px;
box-decoration-break: clone;
-webkit-box-decoration-break: clone;
}
<h1>THE <br> SILK <br> ROAD</h1>
try this -
-moz-box-shadow: 0 0 20px rgba(0,0,0,0.4);
-webkit-box-shadow: 0 0 20px rgba(0,0,0,0.4);
box-shadow: 0 0 20px rgba(0,0,0,0.4);
instead of -
-webkit-box-shadow: 15px 0 #0e0303, -15px 0 pink;
-moz-box-shadow: 15px 0 #0e0303, -15px 0 pink;
box-shadow: 15px 0 #0e0303, -15px 0 pink;
You don't need to use box-shadow to have the background color on the text only.
Instead, you can try this:
.background-on-text{
background-color: #1b0f0f;
color: #fff;
line-height: 1.4;
padding: 0 15px;
letter-spacing: 4px;
font-size: 50px;
}
<h1><span class="background-on-text">THE <br> SILK <br> ROAD</span></h1>
I hope it helps.
You are using black color everywhere so you cannot see the effect of the box-shadow. Try this code, it will run in mozilla as well as in the chrome browser.
h1 {
color: #fff;
font-size: 50px;
background: red;
-webkit-box-shadow: 15px 0 #0e0303, -15px 0 pink;
-ms-box-shadow: 15px 0 #0e0303, -15px 0 pink;
-moz-box-shadow: 15px 0 #0e0303, -15px 0 pink;
box-shadow: 15px 0 #0e0303, -15px 0 pink;
padding: 0;
line-height: 1.4!important;
display: inline!important;
text-align: justify;
letter-spacing: 4px;
}
<h1>THE <br> SILK <br> ROAD</h1>
I have a problem with unwanted gap between ul and div. Maybe you know solution?
#tabs {
overflow: hidden;
width: 100%;
margin: 0;
padding: 0;
list-style: none;
text-align: center;
font-size: 0;
}
#tabs li {
display: inline-block;
margin: 0 .5em 0 0;
}
#tabs a {
position: relative;
background: #ddd;
background-image: linear-gradient(to bottom, #fff, #ddd);
padding: .7em 3.5em;
float: left;
text-decoration: none;
color: #444;
text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
border-radius: 5px 0 0 0;
box-shadow: 0 2px 2px rgba(0, 0, 0, .4);
font-size: 16px;
}
#content {
background: #fff;
padding: 2em;
height: 220px;
position: relative;
z-index: 2;
border-radius: 0 5px 5px 5px;
box-shadow: 0 -2px 3px -2px rgba(0, 0, 0, .5);
width: 1100px;
margin-left: auto;
margin-right: auto;
}
<ul id="tabs">
<li>First</li>
<li>Second</li>
<li>Random</li>
</ul>
<div id="content">
<div id="tab1">...</div>
<div id="tab2">...</div>
<div id="tab3">...</div>
</div>
This problem occurred after inline-block adding. I searched for solutions, but what I have found that was for horizontal gaps (I have fixed it by adding font-size: 0; in parent tab). Maybe there is some solution for vertical gaps?
in #content add float:left; margin-top:0;
Remove the font-size:0
and edit margin to this
#tabs li {
margin: 0 0;
}
you gave it 0.5em which is causing the space between them
Hope it helps
You added padding to the content div which caused this effect
Here's a fiddle where I changed the padding to 0 2em instead
https://jsfiddle.net/6r0x3n0e/
#content {
background: #fff;
padding: 0 2em;
height: 220px;
position: relative;
z-index: 2;
border-radius: 0 5px 5px 5px;
box-shadow: 0 -2px 3px -2px rgba(0, 0, 0, .5);
width: 1100px;
margin-left: auto;
margin-right: auto;
}
Hope this helps
Set padding to the following: padding:0em 2em 2em 2em;
#tabs {
overflow: hidden;
width: 100%;
margin: 0;
padding: 0;
list-style: none;
text-align: center;
font-size: 0;
}
#tabs li {
display: inline-block;
margin: 0 .5em 0 0;
}
#tabs a {
position: relative;
background: #ddd;
background-image: linear-gradient(to bottom, #fff, #ddd);
padding: .7em 3.5em;
float: left;
text-decoration: none;
color: #444;
text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
border-radius: 5px 0 0 0;
box-shadow: 0 2px 2px rgba(0, 0, 0, .4);
font-size: 16px;
}
#content {
background: #fff;
padding: 0em 2em 2em 2em;
height: 220px;
position: relative;
z-index: 2;
border-radius: 0 5px 5px 5px;
box-shadow: 0 -2px 3px -2px rgba(0, 0, 0, .5);
width: 1100px;
margin-left: auto;
margin-right: auto;
}
<ul id="tabs">
<li>First</li>
<li>Second</li>
<li>Random</li>
</ul>
<div id="content">
<div id="tab1">...</div>
<div id="tab2">...</div>
<div id="tab3">...</div>
</div>
i'm not even sure why this is happening, Its a Css error but im not sure where
I'm doing this in rails so im relatively new to this but it should be standard css!
As you can see the element "ticket" is hidden behind the cards (not sure why), I'm wanting the ticket above the images so it can be editable!
Here is the code
Css
// Place all the styles related to the view controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
.box{
position: absolute;
top: calc(50% - 125px);
top: -webkit-calc(50% - 125px);
left: calc(50% - 300px);
left: -webkit-calc(50% - 300px);
}
.ticket{
width: 600px;
height: 250px;
background: #FFB300;
border-radius: 3px;
box-shadow: 0 0 100px #aaa;
border-top: 1px solid #E89F3D;
border-bottom: 1px solid #E89F3D;
}
.left{
margin: 0;
padding: 0;
list-style: none;
position: absolute;
top: 0px;
left: -5px;
}
.left li{
width: 0px;
height: 0px;
}
.left li:nth-child(-n+2){
margin-top: 8px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-right: 5px solid #FFB300;
}
.left li:nth-child(3),
.left li:nth-child(6){
margin-top: 8px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-right: 5px solid #EEEEEE;
}
.left li:nth-child(4){
margin-top: 8px;
margin-left: 2px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-right: 5px solid #EEEEEE;
}
.left li:nth-child(5){
margin-top: 8px;
margin-left: -1px;
border-top: 6px solid transparent;
border-bottom: 6px solid transparent;
border-right: 6px solid #EEEEEE;
}
.left li:nth-child(7),
.left li:nth-child(9),
.left li:nth-child(11),
.left li:nth-child(12){
margin-top: 7px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-right: 5px solid #E5E5E5;
}
.left li:nth-child(8){
margin-top: 7px;
margin-left: 2px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-right: 5px solid #E5E5E5;
}
.left li:nth-child(10){
margin-top: 7px;
margin-left: 1px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-right: 5px solid #E5E5E5;
}
.left li:nth-child(13){
margin-top: 7px;
margin-left: 2px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-right: 5px solid #FFB300;
}
.left li:nth-child(14){
margin-top: 7px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-right: 5px solid #FFB300;
}
.right{
margin: 0;
padding: 0;
list-style: none;
position: absolute;
top: 0px;
right: -5px;
}
.right li:nth-child(-n+2){
margin-top: 8px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid #FFB300;
}
.right li:nth-child(3),
.right li:nth-child(4),
.right li:nth-child(6){
margin-top: 8px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid #EEEEEE;
}
.right li:nth-child(5){
margin-top: 8px;
margin-left: -2px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid #EEEEEE;
}
.right li:nth-child(8),
.right li:nth-child(9),
.right li:nth-child(11){
margin-top: 7px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid #E5E5E5;
}
.right li:nth-child(7){
margin-top: 7px;
margin-left: -3px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid #E5E5E5;
}
.right li:nth-child(10){
margin-top: 7px;
margin-left: -2px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid #E5E5E5;
}
.right li:nth-child(12){
margin-top: 7px;
border-top: 6px solid transparent;
border-bottom: 6px solid transparent;
border-left: 6px solid #E5E5E5;
}
.right li:nth-child(13),
.right li:nth-child(14){
margin-top: 7px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid #FFB300;
}
.ticket:after{
content: '';
position: absolute;
right: 200px;
top: 0px;
width: 2px;
height: 250px;
box-shadow: inset 0 0 0 #FFB300,
inset 0 -10px 0 #B56E0A,
inset 0 -20px 0 #FFB300,
inset 0 -30px 0 #B56E0A,
inset 0 -40px 0 #FFB300,
inset 0 -50px 0 #999999,
inset 0 -60px 0 #E5E5E5,
inset 0 -70px 0 #999999,
inset 0 -80px 0 #E5E5E5,
inset 0 -90px 0 #999999,
inset 0 -100px 0 #E5E5E5,
inset 0 -110px 0 #999999,
inset 0 -120px 0 #E5E5E5,
inset 0 -130px 0 #999999,
inset 0 -140px 0 #E5E5E5,
inset 0 -150px 0 #B0B0B0,
inset 0 -160px 0 #EEEEEE,
inset 0 -170px 0 #B0B0B0,
inset 0 -180px 0 #EEEEEE,
inset 0 -190px 0 #B0B0B0,
inset 0 -200px 0 #EEEEEE,
inset 0 -210px 0 #B0B0B0,
inset 0 -220px 0 #FFB300,
inset 0 -230px 0 #B56E0A,
inset 0 -240px 0 #FFB300,
inset 0 -250px 0 #B56E0A;
}
.ticket:before{
content: '';
position: absolute;
z-index: 5;
right: 199px;
top: 0px;
width: 1px;
height: 250px;
box-shadow: inset 0 0 0 #FFB300,
inset 0 -10px 0 #F4D483,
inset 0 -20px 0 #FFB300,
inset 0 -30px 0 #F4D483,
inset 0 -40px 0 #FFB300,
inset 0 -50px 0 #FFFFFF,
inset 0 -60px 0 #E5E5E5,
inset 0 -70px 0 #FFFFFF,
inset 0 -80px 0 #E5E5E5,
inset 0 -90px 0 #FFFFFF,
inset 0 -100px 0 #E5E5E5,
inset 0 -110px 0 #FFFFFF,
inset 0 -120px 0 #E5E5E5,
inset 0 -130px 0 #FFFFFF,
inset 0 -140px 0 #E5E5E5,
inset 0 -150px 0 #FFFFFF,
inset 0 -160px 0 #EEEEEE,
inset 0 -170px 0 #FFFFFF,
inset 0 -180px 0 #EEEEEE,
inset 0 -190px 0 #FFFFFF,
inset 0 -200px 0 #EEEEEE,
inset 0 -210px 0 #FFFFFF,
inset 0 -220px 0 #FFB300,
inset 0 -230px 0 #F4D483,
inset 0 -240px 0 #FFB300,
inset 0 -250px 0 #F4D483;
}
.content{
position: absolute;
top: 40px;
width: 100%;
height: 170px;
background: #eee;
}
.airline{
position: absolute;
top: 10px;
left: 10px;
font-family: Arial;
font-size: 20px;
font-weight: bold;
color: rgba(0,0,102,1);
}
.boarding{
position: absolute;
top: 10px;
right: 220px;
font-family: Arial;
font-size: 18px;
color: rgba(255,255,255,0.6);
}
.jfk{
position: absolute;
top: 10px;
left: 20px;
font-family: Arial;
font-size: 38px;
color: #222;
}
.sfo{
position: absolute;
top: 10px;
left: 180px;
font-family: Arial;
font-size: 38px;
color: #222;
}
.plane{
position: absolute;
left: 105px;
top: 0px;
}
.sub-content{
background: #e5e5e5;
width: 100%;
height: 100px;
position: absolute;
top: 70px;
}
.watermark{
position: absolute;
left: 5px;
top: -10px;
font-family: Arial;
font-size: 110px;
font-weight: bold;
color: rgba(255,255,255,0.2);
}
.name{
position: absolute;
top: 10px;
left: 10px;
font-family: Arial Narrow, Arial;
font-weight: bold;
font-size: 14px;
color: #999;
}
.name span{
color: #555;
font-size: 17px;
}
.flight{
position: absolute;
top: 10px;
left: 180px;
font-family: Arial Narrow, Arial;
font-weight: bold;
font-size: 14px;
color: #999;
}
.flight span{
color: #555;
font-size: 17px;
}
.gate{
position: absolute;
top: 10px;
left: 280px;
font-family: Arial Narrow, Arial;
font-weight: bold;
font-size: 14px;
color: #999;
}
.gate span{
color: #555;
font-size: 17px;
}
.seat{
position: absolute;
top: 10px;
left: 350px;
font-family: Arial Narrow, Arial;
font-weight: bold;
font-size: 14px;
color: #999;
}
.seat span{
color: #555;
font-size: 17px;
}
.boardingtime{
position: absolute;
top: 60px;
left: 10px;
font-family: Arial Narrow, Arial;
font-weight: bold;
font-size: 14px;
color: #999;
}
.boardingtime span{
color: #555;
font-size: 17px;
}
.barcode{
position: absolute;
left: 8px;
bottom: 6px;
height: 30px;
width: 90px;
background: #222;
box-shadow: inset 0 1px 0 #FFB300, inset -2px 0 0 #FFB300,
inset -4px 0 0 #222,
inset -5px 0 0 #FFB300,
inset -6px 0 0 #222,
inset -9px 0 0 #FFB300,
inset -12px 0 0 #222,
inset -13px 0 0 #FFB300,
inset -14px 0 0 #222,
inset -15px 0 0 #FFB300,
inset -16px 0 0 #222,
inset -17px 0 0 #FFB300,
inset -19px 0 0 #222,
inset -20px 0 0 #FFB300,
inset -23px 0 0 #222,
inset -25px 0 0 #FFB300,
inset -26px 0 0 #222,
inset -26px 0 0 #FFB300,
inset -27px 0 0 #222,
inset -30px 0 0 #FFB300,
inset -31px 0 0 #222,
inset -33px 0 0 #FFB300,
inset -35px 0 0 #222,
inset -37px 0 0 #FFB300,
inset -40px 0 0 #222,
inset -43px 0 0 #FFB300,
inset -44px 0 0 #222,
inset -45px 0 0 #FFB300,
inset -46px 0 0 #222,
inset -48px 0 0 #FFB300,
inset -49px 0 0 #222,
inset -50px 0 0 #FFB300,
inset -52px 0 0 #222,
inset -54px 0 0 #FFB300,
inset -55px 0 0 #222,
inset -57px 0 0 #FFB300,
inset -59px 0 0 #222,
inset -61px 0 0 #FFB300,
inset -64px 0 0 #222,
inset -66px 0 0 #FFB300,
inset -67px 0 0 #222,
inset -68px 0 0 #FFB300,
inset -69px 0 0 #222,
inset -71px 0 0 #FFB300,
inset -72px 0 0 #222,
inset -73px 0 0 #FFB300,
inset -75px 0 0 #222,
inset -77px 0 0 #FFB300,
inset -80px 0 0 #222,
inset -82px 0 0 #FFB300,
inset -83px 0 0 #222,
inset -84px 0 0 #FFB300,
inset -86px 0 0 #222,
inset -88px 0 0 #FFB300,
inset -89px 0 0 #222,
inset -90px 0 0 #FFB300;
}
.slip{
left: 455px;
}
.nameslip{
top: 60px;
left: 410px;
}
.flightslip{
left: 410px;
}
.seatslip{
left: 540px;
}
.jfkslip{
font-size: 30px;
top: 20px;
left: 410px;
}
.sfoslip{
font-size: 30px;
top: 20px;
left: 530px;
}
.planeslip{
top: 10px;
left: 475px;
}
.airlineslip{
left: 455px;
}
Html
<% title("Home Page") %>
<h1><i class="fa fa-home"></i> Home Page <small>views/pages/home.html.erb</small></h1>
<div class="section" style="background-image: url('https://c2.staticflickr.com/2/1334/1484360775_8391c2ce1a_b.jpg')">
<div class="container" style="color: white">
<div class="box">
<ul class="left">
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
<ul class="right">
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
<div class="ticket">
<span class="airline">Lufthansa</span>
<span class="airline airlineslip">Lufthansa</span>
<span class="boarding">Boarding pass</span>
<div class="content">
<span class="jfk">JFK</span>
<span class="plane"><?xml version="1.0" ?><svg clip-rule="evenodd" fill-rule="evenodd" height="60" width="60" image-rendering="optimizeQuality" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" viewBox="0 0 500 500" xmlns="http://www.w3.org/2000/svg"><g stroke="#222"><line fill="none" stroke-linecap="round" stroke-width="30" x1="300" x2="55" y1="390" y2="390"/><path d="M98 325c-9 10 10 16 25 6l311-156c24-17 35-25 42-50 2-15-46-11-78-7-15 1-34 10-42 16l-56 35 1-1-169-31c-14-3-24-5-37-1-10 5-18 10-27 18l122 72c4 3 5 7 1 9l-44 27-75-15c-10-2-18-4-28 0-8 4-14 9-20 15l74 63z" fill="#222" stroke-linejoin="round" stroke-width="10"/></g></svg></span>
<span class="sfo">SFO</span>
<span class="jfk jfkslip">JFK</span>
<span class="plane planeslip"><?xml version="1.0" ?><svg clip-rule="evenodd" fill-rule="evenodd" height="50" width="50" image-rendering="optimizeQuality" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" viewBox="0 0 500 500" xmlns="http://www.w3.org/2000/svg"><g stroke="#222"><line fill="none" stroke-linecap="round" stroke-width="30" x1="300" x2="55" y1="390" y2="390"/><path d="M98 325c-9 10 10 16 25 6l311-156c24-17 35-25 42-50 2-15-46-11-78-7-15 1-34 10-42 16l-56 35 1-1-169-31c-14-3-24-5-37-1-10 5-18 10-27 18l122 72c4 3 5 7 1 9l-44 27-75-15c-10-2-18-4-28 0-8 4-14 9-20 15l74 63z" fill="#222" stroke-linejoin="round" stroke-width="10"/></g></svg></span>
<span class="sfo sfoslip">SFO</span>
<div class="sub-content">
<span class="watermark">Lufthansa</span>
<span class="name">PASSENGER NAME<br><span>Rex, Anonasaurus</span></span>
<span class="flight">FLIGHT N°<br><span>X3-65C3</span></span>
<span class="gate">GATE<br><span>11B</span></span>
<span class="seat">SEAT<br><span>45A</span></span>
<span class="boardingtime">BOARDING TIME<br><span>8:25PM ON AUGUST 2013</span></span>
<span class="flight flightslip">FLIGHT N°<br><span>X3-65C3</span></span>
<span class="seat seatslip">SEAT<br><span>45A</span></span>
<span class="name nameslip">PASSENGER NAME<br><span>Rex, Anonasaurus</span></span>
</div>
</div>
<div class="barcode"></div>
<div class="barcode slip"></div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col s12 m4">
<div class="card">
<div class="card-image">
<img src="http://admitme.co.uk/img/Artisit%20Images/CalvinHarris.jpg">
<span class="card-title">Card Title</span>
</div>
<div class="card-content">
<p>I am a very simple card. I am good at containing small bits of information.
I am convenient because I require little markup to use effectively.</p>
</div>
<div class="card-action">
This is a link
</div>
</div>
</div>
<div class="col s12 m4">
<div class="card">
<div class="card-image">
<img src="http://admitme.co.uk/img/Artisit%20Images/CalvinHarris.jpg">
<span class="card-title">Card Title</span>
</div>
<div class="card-content">
<p>I am a very simple card. I am good at containing small bits of information.
I am convenient because I require little markup to use effectively.</p>
</div>
<div class="card-action">
This is a link
</div>
</div>
</div>
<div class="col s12 m4">
<div class="card">
<div class="card-image">
<img src="http://admitme.co.uk/img/Artisit%20Images/CalvinHarris.jpg">
<span class="card-title">Card Title</span>
</div>
<div class="card-content">
<p>I am a very simple card. I am good at containing small bits of information.
I am convenient because I require little markup to use effectively.</p>
</div>
<div class="card-action">
This is a link
</div>
</div>
</div>
</div>
Fiddle
Your cards are in a .row div following the ticket. Elements further down in the DOM have a higher z position than the elements above them in the DOM and appear "in front" of them. To alter the normal hierarchy use the z-index property.
.row {
z-index: 1;
}
You could also reverse the hierarchy of your HTML so that the ticket is after the .row. This would work because your natural hierarchy now places the ticket above .row.
To force the ticket element to go to bottom of the previous element (new line) , try adding to .ticket css:
display: list-item;