First off let me say, I don't do a whole lot of front end design so please excuse all my inline code etc...
I've built these check boxes to be able to include the image when clicked. I understand it's not inside the parent class but i'm a bit confused at this point on how to move forward. Since it doesn't have a parent class it just looks for the whole web page as it's parent class i presume.
Fairly simple, i think; when i minimize my screen my label positioning removes itself from the boxes and floats off. I'll attach screen shots for more clarity.
I've tried to put a few of them in divs with some success but i'm not 100% sure the right way of doing this and that's why i'm here. I've tried some relative positioning as well.
<div class="interests">
<div class="subHeader">Interests:</div>
<label style="background-color: #000; color:#fff; width:160px; font-family: 'itc_avant_garde_gothic_ltbold';
font-size: 18px !important;
text-transform: uppercase;
color: #FFF;
padding-top: 20px;
display: inline-block; z-index: 5; position:absolute; left: 465px; top: 1105px;"><div style="position:relative;left:10px; bottom: 8px;">SKATE</div></label>
<label style="background-color: #000; color:#fff; width:160px; font-family: 'itc_avant_garde_gothic_ltbold';
font-size: 18px !important;
text-transform: uppercase;
color: #FFF;
padding-top: 20px;
display: inline-block; z-index: 5; position:absolute; left: 685px; top: 1105px;"><div style="position:relative;left:10px; bottom: 8px;">SURF</div></label>
<label style="background-color: #000; color:#fff; width:160px; font-family: 'itc_avant_garde_gothic_ltbold';
font-size: 18px !important;
text-transform: uppercase;
color: #FFF;
padding-top: 20px;
display: inline-block; z-index: 5; position:absolute; left: 906px; top: 1105px;"><div style="position:relative;left:10px; bottom: 8px;">SNOW</div></label>
<label style="background-color: #000; color:#fff; width:160px; font-family: 'itc_avant_garde_gothic_ltbold';
font-size: 18px !important;
text-transform: uppercase;
color: #FFF;
padding-top: 20px;
display: inline-block; z-index: 5; position:absolute; left: 465px; top: 1300px;"><div style="position:relative;left:10px; bottom: 8px;"> WOMEN</div></label>
<label style="background-color: #000; color:#fff; width:160px; font-family: 'itc_avant_garde_gothic_ltbold';
font-size: 18px !important;
text-transform: uppercase;
color: #FFF;
padding-top: 20px;
display: inline-block; z-index: 5; position:absolute; left: 685px; top: 1300px;"><div style="position:relative;left:10px; bottom: 8px;"> MUSIC/ART </div></label>
<label style="position: relative; top: 90px;">
<input type="checkbox" name="CheckBox.A address.Sk" style="z-index: 1;position: relative; top:4px;">Skate<img src="https://stuff/Images/thumb.jpg" style="position: absolute;left: 0;bottom: 0;height: 185px;width: 205px;">
</label>
<input type="hidden" name="CheckBox.A address.Sk" value="off">
<label style="position: relative; left:140px; top: 90px;">
<input type="checkbox" name="CheckBox.A address.Su" style="z-index: 1;position: relative; top:4px;">Surf<img src="https://stuff/Images/thumb.jpg" style="position: absolute;left: 0;bottom: 0;height: 185px;width: 205px;">
</label>
<input type="hidden" name="CheckBox.A address.Su" value="off">
<label style="position: relative; left:290px; top: 90px;">
<input type="checkbox" name="CheckBox.A address.Sn" style="z-index: 1;position: relative; top:4px;">Snow<img src="https://stuff/Images/thumb.jpg" style="position: absolute;left: 0;bottom: 0;height: 185px;width:205px;">
</label>
<input type="hidden" name="CheckBox.A address.Sn" value="off">
<br><br><br><br><br><br><br><br><br><br><br><br>
<label style="position:relative; top: 60px;">
<input type="checkbox" name="CheckBox.A address.Wo" style="z-index: 1;position: relative; top:4px;">Women<img src="https://stuff/Images/thumb.jpg" style="position: absolute;left: 0;bottom: 0;height: 185px;width:205px;">
</label>
<input type="hidden" name="CheckBox.A address.Wo" value="off">
<label style="position:relative; left: 130px; top: 60px;">
<input type="checkbox" name="CheckBox.A address.Mu" style="z-index: 1;position: relative; top:4px;">Music<img src="https://stuff/Images/music_thumb.jpg" style="position: absolute;left: 0;bottom: 0;height: 185px;width:205px;">
</label><input type="hidden" name="CheckBox.A address.Mu " value="off">
<label><input type="checkbox" name="CheckBox.A address.Subscribe"></label>
<div style="position:relative; left: 50px; bottom: 33px;">Subscribe</div>
<input type="hidden" name="CheckBox.A address.Subscribe" value="off">
<input type="submit" id="submit" value="Sign Up" style="width: 280px;
height: 45px;
display: block !important;
outline-style: none !important;
outline-width: 0px !important;
color: #fff !important;
font-weight: normal !important;
font-family: 'itc_avant_garde_gothic_ltbold';
text-transform: uppercase;
text-decoration: none;
text-align: center;
border: 1px solid #434242;
background-color: #434242;
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#434242), to(#2f2e2e));
background-image: -webkit-linear-gradient(top, #434242, #2f2e2e);
background-image: -moz-linear-gradient(top, #434242, #2f2e2e);
background-image: -ms-linear-gradient(top, #434242, #2f2e2e);
background-image: -o-linear-gradient(top, #434242, #2f2e2e);
-moz-box-shadow: 0 0 1px #bbb;
-webkit-box-shadow: 0 0 1px #bbb;
box-shadow: 0 0 1px #bbb;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
vertical-align: middle;
padding: 10px 0;
line-height: 1em;
cursor: pointer;
line-height: 18px;
font-size: 18px;
margin: 40px 0;">
</div>
Any help would be greatly appreciated. Thank you. Screen shots below.
Labels are floating off when i minimize :
Works fine when full screen :
I commented with a few bad practices and falsehoods on another answer, so I really had to make a quick example myself, this is one way to do it with flexbox (there are a lot of solutions to this problem, this is a good one if you don't have to support obsolete browsers):
Example: https://jsfiddle.net/um6fm744/1/
CSS:
* { box-sizing: border-box; margin: 0; padding: 0; }
.interests {
display: flex;
flex-wrap: wrap;
}
.sub-header {
margin: 0 0 24px;
width: 100%;
}
.interest {
align-items: flex-end;
background-color: green;
display: flex;
margin: 0 12px 24px 0;
min-height: 160px;
width: 160px;
}
.interest-info {
background-color: black;
display: flex;
justity-content: space-between;
width: 100%;
}
.interest-checkbox {
height: 30px;
width: 30px;
}
.interest-label {
color: white;
font-family: sans-serif;
flex: 1;
height: 30px;
line-height: 30px;
margin-left: 12px;
}
HTML
<div class="interests">
<h1 class="sub-header">Interests:</h1>
<div class="interest">
<div class="interest-info">
<input class="interest-checkbox" type="checkbox" />
<label class="interest-label">SKATE</label>
</div>
</div>
<div class="interest">
<div class="interest-info">
<input class="interest-checkbox" type="checkbox" />
<label class="interest-label">SNOW</label>
</div>
</div>
<div class="interest">
<div class="interest-info">
<input class="interest-checkbox" type="checkbox" />
<label class="interest-label">WOMEN</label>
</div>
</div>
<div class="interest">
<div class="interest-info">
<input class="interest-checkbox" type="checkbox" />
<label class="interest-label">SURF</label>
</div>
</div>
<div class="interest">
<div class="interest-info">
<input class="interest-checkbox" type="checkbox" />
<label class="interest-label">MUSIC/ART</label>
</div>
</div>
</div>
Please don't use inline styling.
I would tackle it more like this: http://codepen.io/anon/pen/VeEXEv
HTML:
<ul class="items">
<li class="item1">
<button class="add-button">+</button>
<span class="description">box 1</span>
</li>
<li class="item2">
<button class="add-button">+</button>
<span class="description">box 2</span>
</li>
<li class="item3">
<button class="add-button">+</button>
<span class="description">box 3</span>
</li>
<li class="item2">
<button class="add-button">+</button>
<span class="description">box 2</span>
</li>
<li class="item3">
<button class="add-button">+</button>
<span class="description">box 3</span>
</li>
<li class="item1">
<button class="add-button">+</button>
<span class="description">box 1</span>
</li>
</ul>
CSS:
.items > li {
list-style: none;
float: left;
height: 20px;
width: 100px;
margin: 10px;
border: 1px #000 solid;
position: relative;
padding-top: 80px;
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
}
.items .description {
background: rgba(0,0,0,0.8);
height: 20px;
width: 80px;
color: #fff;
display: block;
float: right;
text-align: center;
}
.items .add-button {
width: 20px;
height: 20px;
border: none;
background-color: #666;
color: #fff;
}
.item1 {
background-image: url(https://pbs.twimg.com/profile_images/586137164188004352/wTK4hjbl.jpg);
}
.item2 {
background-image: url(https://pbs.twimg.com/profile_images/3276050019/f1d244a9f3254f30176922985c761d28.png);
}
.item3 {
background-image: url(https://people.rit.edu/~bmd6715/230/exercises/images/cat.png);
}
Related
I'm creating a homepage for my website and want a logo (avatar) to appear on the left hand side of the page and a login form to appear on the right hand side. My current code displays a centered login box and avatar. The avatar is directly above the login box (and slightly offscreen).
Ideally I'm looking to replicate facebooks homepage theme (facebook.com)
Any ideas?
html
{% load static %}
{#<link rel="stylesheet" type="text/css" href="{% static 'homepage/style.css' %}">#}
<html lang="">
<head>
<title>Login Form</title>
<link rel="stylesheet" type="text/css" href="{% static "homepage/style.css" %}">
<body>
<div class="rows">
<div class="logo">
<img src="{% static "homepage/images/my_logo.png" %}"
class="avatar"
alt=""
width=""
height="">
</div>
<div class="login-box">
<h1>Login</h1>
<form>
<p>Username</p>
<input type="text" name="" placeholder="Enter Username">
<p>Password</p>
<input type="password" name="" placeholder="Enter Password">
<input type="submit" name="" value="Login">
Forgot password?<br>
Sign-up<br>
</form>
</div>
</div>
</body>
</html>
css
body {
margin: 0;
padding: 0;
background-size: cover;
background: black center;
font-family: sans-serif;
}
.avatar {
float: left;
width: 200px;
height: 200px;
border-radius: 50%;
position: absolute;
top: -75px;
left: calc(50% - 100px);
}
.login-box{
float: right;
width: 320px;
height: 420px;
background: #000;
color: #fff;
top: 50%;
left: 50%;
position: absolute;
transform: translate(-50%, -50%);
box-sizing: border-box;
padding: 70px 30px;
}
h1 {
margin: 0;
padding: 0 0 20px;
text-align: center;
font-size: 22px;
}
.login-box p {
margin: 0;
padding: 0;
font-weight: bold;
}
.login-box input {
width: 100%;
margin-bottom: 20px;
}
.login-box input[type="text"], input[type="password"] {
border: none;
border-bottom: 1px solid #fff;
background: transparent;
outline: none;
height: 40px;
color: #fff;
font-size: 16px;
}
.login-box input[type="submit"] {
border: none;
outline: none;
height: 40px;
background: #ffc107;
color: #fff;
font-size: 18px;
border-radius: 20px;
}
.login-box input[type="submit"]:hover {
cursor: pointer;
background: lightgray;
color: #000;
}
.login-box a {
text-decoration: none;
font-size: 12px;
line-height: 20px;
color: darkgrey;
}
.login-box a:hover {
color: #ffc107;
}
Here is a basic example of placing two items side by side across the screen. The first uses display grid, and outlines 2 columns, the second is using flex.
img{
height: 50vh;
}
.grid-container{
display: grid;
height: 50vh;
grid-template-columns: auto 1fr;
}
.flex-container{
display: flex;
height: 50vh;
}
.login {
display: flex;
flex-direction: column;
}
<div class="grid-container">
<img src="https://picsum.photos/seed/picsum/200/200" alt="">
<div class="login">
<h1>Login</h1>
<form>
<div>
<label for="email">Email</label>
<input type="text" name="email">
</div>
<div>
<label for="paswd">Password</label>
<input type="password" name="passwd">
</div>
</form>
</div>
</div>
<div class="flex-container">
<img src="https://picsum.photos/seed/picsum/200/200" alt="">
<div class="login">
<h1>Login</h1>
<form>
<div>
<label for="email">Email</label>
<input type="text" name="email">
</div>
<div>
<label for="paswd">Password</label>
<input type="password" name="passwd">
</div>
</form>
</div>
</div>
I'm trying to make this:
But for now I have this:
I don't understand how I can resize input with icon on right... I am on col-md-12...
You can look my code here:
.form {
margin-top: 8px;
margin-left: 13px;
display: flex;
flex-direction: row;
}
.search-field {
padding: 10px 35px 10px 15px;
color: #fff;
border-color: #d4e0e0;
border-radius: 15px;
outline: none;
background: #FFFFFF 0% 0% no-repeat padding-box;
box-shadow: inset 0px 3px 6px #0000000D;
border: 1px solid #D4E0E0;
width: auto;
color: #000;
}
.search-button {
z-index: 1;
float: inline-end;
background: transparent;
border: none;
outline: none;
margin-top: -2px;
margin-left: -45px;
}
.search-button img {
width: 20px;
height: 20px;
object-fit: cover;
}
<div class="container">
<div class="list row">
<span class="font-link-bold" style={{ fontSize: "26px" }}>
<span class="title-card font-link-blue-bold">Mes </span>Conseils
</span>
<div class="button-create">
<IconCreate /> Créer un nouveau conseil
</div>
<br />
<br />
<span
class="font-link"
style={{ fontSize: "16px", color: "#657273" }}
>
Saisir vos mots-clés ou coller un texte :
</span>
</div>
<div class="row">
<div class="col-md-12">
<form action="/" method="GET" class="form">
<input
type="search"
placeholder="Search"
class="search-field"
/>
<button type="submit" class="search-button">
<img src={IconLoupe} alt="" />
</button>
</form>
</div>
</div>
</div>
In my html you can see "col-md-12" and the other col-md-12 take all space... just input take an col-md-3 or 6...
Try giving width 100% to .search-field
.search-field {
width: 100% !important;
}
It should work or you can also try giving position to your icon
parent{
position: relative;
}
child{
position: absolute;
top: 5px;
right: 20px;
}
I have this page, I'm using fleboxes and I need to the boxes be something like
My code now:
<div class="cardActions">
<h2 style="display:inline">Card Actions | <i class="fas fa-home"></i> </h2> >> eCommerce >> Eletronics
</div>
<div class="filters">
<div class="container column">
<p style="margin-top: 8%; margin-bottom: 5%; margin-left: 4% ;font-weight: bold;"> Multi Range
</p>
<div class="checkBoxes">
<input type="radio" name="multiRange" style="display: inline;" id="radio1">
<label for="radio1">$10</label> <br>
<input type="radio" name="multiRange" id="radio2">
<label for="radio2">$10-$100</label> <br>
<input type="radio" name="multiRange" id="radio3">
<label for="radio3">$100-$500</label> <br>
<input type="radio" name="multiRange" id="radio4">
<label for="radio4">$500</label> <br>
<input type="radio" name="multiRange" id="radio5">
<label for="radio5">All</label>
</div>
<p style="font-weight: bold; margin-top: 10%; margin-left: 4%">
Slider<input type="text" id="amount" readonly style="border:0; font-weight:bold; background-color: #ffab00; margin-left: 35%;">
</p>
<div style="background-color: #091e42; width: 80%; margin-left: 5%; margin-right: 5%; margin-top: 10%; margin-bottom: 10%;"
id="slider-range"></div>
<hr class="solid">
<p style="margin-top: 10%; margin-left: 4% ; margin-bottom: 10%; font-weight: bold;"> Category
</p>
<div class="checkBoxes">
<input type="checkbox" id="check1"> <label for="check1">Teste</label> <br>
<input type="checkbox" id="check2"> <label for="check2">Teste</label> <br>
<input type="checkbox" id="check3"> <label for="check3">Teste</label> <br>
<input type="checkbox" id="check4"> <label for="check4">Teste</label> <br>
<input type="checkbox" id="check5"> <label for="check5">Teste</label> <br>
<input type="checkbox" id="check6"> <label for="check6">Teste</label> <br>
<input type="checkbox" id="check7"> <label for="check7">Teste</label> <br>
<input type="checkbox" id="check8"> <label for="check8">Teste</label> <br>
<input type="checkbox" id="check9"> <label for="check9">Teste</label> <br>
<input type="checkbox" id="check10"> <label for="check10">Teste</label>
</div>
<hr class="solid">
<p style="margin-top: 10%; margin-bottom: 10%; margin-left: 4%; font-weight: bold;">
Brand
</p>
<div class="checkBoxes">
<input type="checkbox" id="check1"> <label for="check1">Teste</label> <br>
<input type="checkbox" id="check2"> <label for="check2">Teste</label> <br>
<input type="checkbox" id="check3"> <label for="check3">Teste</label> <br>
<input type="checkbox" id="check4"> <label for="check4">Teste</label> <br>
<input type="checkbox" id="check5"> <label for="check5">Teste</label> <br>
<input type="checkbox" id="check6"> <label for="check6">Teste</label> <br>
<input type="checkbox" id="check7"> <label for="check7">Teste</label> <br>
<input type="checkbox" id="check8"> <label for="check8">Teste</label> <br>
<input type="checkbox" id="check9"> <label for="check9">Teste</label> <br>
<input type="checkbox" id="check10"> <label for="check10">Teste</label>
</div>
<hr class="solid">
<p style="margin-top: 10%; margin-bottom: 10%; margin-left: 4%; font-weight: bold;">
Rating
</p>
<div class="rating">
<span style="color: white;">☆</span>
<span>☆</span>
<span>☆</span>
<span>☆</span>
<span>☆</span>
</div>
<div class="rating">
<span style="color: white;">☆</span>
<span>☆</span>
<span>☆</span>
<span>☆</span>
<span>☆</span>
</div>
<div class="rating">
<span style="color: white;">☆</span>
<span>☆</span>
<span>☆</span>
<span>☆</span>
<span>☆</span>
</div>
</div> <!--Fim-->
The css:
#import url('https://fonts.googleapis.com/css?family=Josefin+Sans&display=swap');
*{
margin: 0;
padding: 0;
box-sizing: border-box;
list-style: none;
text-decoration: none;
font-family: 'Josefin Sans', sans-serif;
}
body{
background-color: #f3f5f9;
}
.wrapper{
display: flex;
position: relative;
}
.wrapper .sidebar{
width: 200px;
height: 100%;
background: #091e42;
padding: 30px 0px;
position: fixed;
}
.wrapper .sidebar h2{
color: #fff;
text-transform: uppercase;
text-align: center;
margin-bottom: 30px;
}
.wrapper .sidebar ul li{
padding: 15px;
border-bottom: 1px solid #bdb8d7;
border-bottom: 1px solid rgba(0,0,0,0.05);
border-top: 1px solid rgba(255,255,255,0.05);
}
.wrapper .sidebar ul li a{
color: #bdb8d7;
display: block;
}
.wrapper .sidebar ul li a .fas{
width: 25px;
}
.wrapper .sidebar ul li:hover{
background-color: #36b37e;
}
.wrapper .sidebar ul li:hover a{
color: #fff;
}
.wrapper .sidebar .social_media{
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
display: flex;
}
.wrapper .sidebar .social_media a{
display: block;
width: 40px;
background: #36b37e;
height: 40px;
line-height: 45px;
text-align: center;
margin: 0 5px;
color: #bdb8d7;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
.wrapper .main_content{
width: 100%;
margin-left: 200px;
}
.wrapper .main_content .header{
padding: 20px;
background: #fff;
color: #717171;
border-bottom: 1px solid #e0e4e8;
}
.header{
padding: 20px;
background: #fff;
color: #717171;
border-bottom: 1px solid #e0e4e8;
margin-top: 1%;
margin-bottom: 1%;
margin-left: 2%;
margin-right: 2%;
}
.filters{
width: 18%;
height: 88%;
background-color: #ffab00;
display: flex;
flex-wrap: wrap;
margin-left: 1%;
margin-top: 1%;
border-radius: 10px;
}
.cardActions{
margin-left: 2%;
}
.wrapper .main_content .info{
margin: 20px;
color: #717171;
line-height: 25px;
}
.wrapper .main_content .info div{
margin-bottom: 20px;
}
#media (max-height: 500px){
.social_media{
display: none !important;
}
}
.topIcons{
margin-right: 2%;
}
.container {
margin: 0 auto;
display: flex;
}
.column {
flex-direction: column;
height: fit-content;
width: 100%;
justify-content: flex-start;
}
input[type="radio"]{
margin-left: 4%;
margin-bottom: 5%;
}
input[type="checkbox"]{
margin-left: 4%;
margin-bottom: 5%;
}
hr.solid {
border-top: 1px solid white;
margin-left: 4%;
margin-right: 4%;
}
/* Products */
.products{
width: 78%;
height: 13%;
background-color: #091e42;
flex-direction: row;
display: block;
margin-left: 50%;
}
/* Rating */
/*
Ratings Stars
(with as little code as possible)
*/
.rating {
unicode-bidi: bidi-override;
direction: rtl;
text-align: center;
color: white;
font-size: x-large;
}
.rating > span {
display: inline-block;
position: relative;
width: 1.1em;
}
.rating > span:hover,
.rating > span:hover ~ span {
color: transparent;
}
.rating > span:hover:before,
.rating > span:hover ~ span:before {
content: "\2605";
position: absolute;
left: 0;
color: gold;
}
Right now I cant manage to make this, can someone help me?
I need to create boxes like the red ones in the picture.
I tried everything and still can't make this work.
Is there something i'm missing or making wrong?
All you need to do is, put a sibling to your filter div and make their parent display: flex; one did this, then give the remaining width to your right side red-bordered section. for example, you have give filter width: 18%; margin-left: 1%; which makes it 19% and now you have 81% in hand, so distribute it accordingly in width and margin to right side div. Apply other stylings as per you need.
#import url('https://fonts.googleapis.com/css?family=Josefin+Sans&display=swap');
*{
margin: 0;
padding: 0;
box-sizing: border-box;
list-style: none;
text-decoration: none;
font-family: 'Josefin Sans', sans-serif;
}
body{
background-color: #f3f5f9;
}
.wrapper{
display: flex;
position: relative;
}
.wrapper .sidebar{
width: 200px;
height: 100%;
background: #091e42;
padding: 30px 0px;
position: fixed;
}
.wrapper .sidebar h2{
color: #fff;
text-transform: uppercase;
text-align: center;
margin-bottom: 30px;
}
.wrapper .sidebar ul li{
padding: 15px;
border-bottom: 1px solid #bdb8d7;
border-bottom: 1px solid rgba(0,0,0,0.05);
border-top: 1px solid rgba(255,255,255,0.05);
}
.wrapper .sidebar ul li a{
color: #bdb8d7;
display: block;
}
.wrapper .sidebar ul li a .fas{
width: 25px;
}
.wrapper .sidebar ul li:hover{
background-color: #36b37e;
}
.wrapper .sidebar ul li:hover a{
color: #fff;
}
.wrapper .sidebar .social_media{
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
display: flex;
}
.wrapper .sidebar .social_media a{
display: block;
width: 40px;
background: #36b37e;
height: 40px;
line-height: 45px;
text-align: center;
margin: 0 5px;
color: #bdb8d7;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
.wrapper .main_content{
width: 100%;
margin-left: 200px;
}
.wrapper .main_content .header{
padding: 20px;
background: #fff;
color: #717171;
border-bottom: 1px solid #e0e4e8;
}
.header{
padding: 20px;
background: #fff;
color: #717171;
border-bottom: 1px solid #e0e4e8;
margin-top: 1%;
margin-bottom: 1%;
margin-left: 2%;
margin-right: 2%;
}
.filters{
width: 18%;
height: 88%;
background-color: #ffab00;
display: flex;
flex-wrap: wrap;
margin-left: 1%;
margin-top: 1%;
border-radius: 10px;
}
.cardActions{
margin-left: 2%;
}
.wrapper .main_content .info{
margin: 20px;
color: #717171;
line-height: 25px;
}
.wrapper .main_content .info div{
margin-bottom: 20px;
}
#media (max-height: 500px){
.social_media{
display: none !important;
}
}
.topIcons{
margin-right: 2%;
}
.container {
margin: 0 auto;
display: flex;
}
.column {
flex-direction: column;
height: fit-content;
width: 100%;
justify-content: flex-start;
}
input[type="radio"]{
margin-left: 4%;
margin-bottom: 5%;
}
input[type="checkbox"]{
margin-left: 4%;
margin-bottom: 5%;
}
hr.solid {
border-top: 1px solid white;
margin-left: 4%;
margin-right: 4%;
}
/* Products */
.atul {
display: flex;
}
.rightSide {
display: flex;
flex-direction: column;
padding: 10px;
border: 1px solid red;
border-radius: 4px;
width: 80%;
margin-left: 1%;
}
.subSection{
min-height: 50px;
height: 100%;
margin-bottom: 20px;
padding: 10px;
border: 1px solid red;
border-radius: 4px;
}
.products{
width: 78%;
height: 13%;
background-color: #091e42;
flex-direction: row;
display: block;
margin-left: 50%;
}
/* Rating */
/*
Ratings Stars
(with as little code as possible)
*/
.rating {
unicode-bidi: bidi-override;
direction: rtl;
text-align: center;
color: white;
font-size: x-large;
}
.rating > span {
display: inline-block;
position: relative;
width: 1.1em;
}
.rating > span:hover,
.rating > span:hover ~ span {
color: transparent;
}
.rating > span:hover:before,
.rating > span:hover ~ span:before {
content: "\2605";
position: absolute;
left: 0;
color: gold;
}
<div class="cardActions">
<h2 style="display:inline">Card Actions | <i class="fas fa-home"></i> </h2> >> eCommerce >> Eletronics
</div>
<section class="atul">
<div class="filters">
<div class="container column">
<p style="margin-top: 8%; margin-bottom: 5%; margin-left: 4% ;font-weight: bold;"> Multi Range
</p>
<div class="checkBoxes">
<input type="radio" name="multiRange" style="display: inline;" id="radio1">
<label for="radio1">$10</label> <br>
<input type="radio" name="multiRange" id="radio2">
<label for="radio2">$10-$100</label> <br>
<input type="radio" name="multiRange" id="radio3">
<label for="radio3">$100-$500</label> <br>
<input type="radio" name="multiRange" id="radio4">
<label for="radio4">$500</label> <br>
<input type="radio" name="multiRange" id="radio5">
<label for="radio5">All</label>
</div>
<p style="font-weight: bold; margin-top: 10%; margin-left: 4%">
Slider<input type="text" id="amount" readonly style="border:0; font-weight:bold; background-color: #ffab00; margin-left: 35%;">
</p>
<div style="background-color: #091e42; width: 80%; margin-left: 5%; margin-right: 5%; margin-top: 10%; margin-bottom: 10%;" id="slider-range"></div>
<hr class="solid">
<p style="margin-top: 10%; margin-left: 4% ; margin-bottom: 10%; font-weight: bold;"> Category
</p>
<div class="checkBoxes">
<input type="checkbox" id="check1"> <label for="check1">Teste</label> <br>
<input type="checkbox" id="check2"> <label for="check2">Teste</label> <br>
<input type="checkbox" id="check3"> <label for="check3">Teste</label> <br>
<input type="checkbox" id="check4"> <label for="check4">Teste</label> <br>
<input type="checkbox" id="check5"> <label for="check5">Teste</label> <br>
<input type="checkbox" id="check6"> <label for="check6">Teste</label> <br>
<input type="checkbox" id="check7"> <label for="check7">Teste</label> <br>
<input type="checkbox" id="check8"> <label for="check8">Teste</label> <br>
<input type="checkbox" id="check9"> <label for="check9">Teste</label> <br>
<input type="checkbox" id="check10"> <label for="check10">Teste</label>
</div>
<hr class="solid">
<p style="margin-top: 10%; margin-bottom: 10%; margin-left: 4%; font-weight: bold;">
Brand
</p>
<div class="checkBoxes">
<input type="checkbox" id="check1"> <label for="check1">Teste</label> <br>
<input type="checkbox" id="check2"> <label for="check2">Teste</label> <br>
<input type="checkbox" id="check3"> <label for="check3">Teste</label> <br>
<input type="checkbox" id="check4"> <label for="check4">Teste</label> <br>
<input type="checkbox" id="check5"> <label for="check5">Teste</label> <br>
<input type="checkbox" id="check6"> <label for="check6">Teste</label> <br>
<input type="checkbox" id="check7"> <label for="check7">Teste</label> <br>
<input type="checkbox" id="check8"> <label for="check8">Teste</label> <br>
<input type="checkbox" id="check9"> <label for="check9">Teste</label> <br>
<input type="checkbox" id="check10"> <label for="check10">Teste</label>
</div>
<hr class="solid">
<p style="margin-top: 10%; margin-bottom: 10%; margin-left: 4%; font-weight: bold;">
Rating
</p>
<div class="rating">
<span style="color: white;">☆</span>
<span>☆</span>
<span>☆</span>
<span>☆</span>
<span>☆</span>
</div>
<div class="rating">
<span style="color: white;">☆</span>
<span>☆</span>
<span>☆</span>
<span>☆</span>
<span>☆</span>
</div>
<div class="rating">
<span style="color: white;">☆</span>
<span>☆</span>
<span>☆</span>
<span>☆</span>
<span>☆</span>
</div>
</div>
</div>
<div class="rightSide">
<div class="subSection"></div>
<div class="subSection"></div>
<div class="subSection"></div>
<div class="subSection"></div>
</div>
</section>
<div id='listpage'> //here it should be flex-direction:column
<div class='list'>
<div></div>
<div></div>
<div></div>
</div>
<div class='list'>
<div></div>
<div></div>
<div></div>
</div>
</div>
I have a problem with focusing link with tab key in FireFox. Focusing works normal in chrome but in FireFox it loops inside one element.
I have created a example with the described behavior(open it in FireFox)
https://jsfiddle.net/e4gcmk6z/2/
.notVisible {
opacity: 0;
position: fixed;
}
.selection-box-v2 .selection-item {
background: #ffffff;
border: solid;
border-width: 1px;
border-color: #9c9c9c;
border-radius: 3px;
padding: 10px;
display: block;
}
label.label-outline {
font-size: 14px !important;
-webkit-transform: translate(0px, 12px);
transform: translate(0px, 12px);
position: absolute;
padding-right: 5px;
padding-left: 5px;
margin-top: 0px;
left: 18px;
line-height: normal !important;
cursor: text;
color: #5f5f5f;
z-index: 1;
}
.selection-box-v2 .co-calendar {
color: #3071a9;
font-size: 20px;
margin-right: 20px;
margin-top: 10px;
position: absolute;
right: 0;
pointer-events: none;
z-index: 1;
}
<div>
Tab key is not focusing link 2 in FireFox
</div>
<div class="links-v2">
<a tabindex="0" href="javascript:void(0);">
link 1
</a>
</div>
<br>
<div class="col-xs-12 selection-box-v2 pad">
<label tabindex="0" role="radio">
<input type="radio" class="shipModeId notVisible" name="shipModeId_1" value="p79652">
<span class="selection-item preferred-arrival-date-v2 inner-addon right-addon calendar-box">
<input class="ship-date" type="hidden" value="">
<span class="padClause" style="display: none">
<p class="checkout-ship-padClause"> </p>
</span>
<span class="ship-type-and-cost" style="margin-top: 10px;">some other elements
<span class="shipping-cost span-inline calendar-arrival"></span>
</span>
</span>
</label>
</div>
<br>
<div class="links-v2">
<a tabindex="0" href="javascript:void(0);">
link 2
</a>
</div>
Any one has and idea what could be wrong?
You can remove the tab index of the two a tags since they are not needed, also there are some input tags that are not visible on the screen, these need to be set to tabIndex as -1 so that these elements are skipped!
.notVisible {
opacity: 0;
position: fixed;
}
.selection-box-v2 .selection-item {
background: #ffffff;
border: solid;
border-width: 1px;
border-color: #9c9c9c;
border-radius: 3px;
padding: 10px;
display: block;
}
label.label-outline {
font-size: 14px !important;
-webkit-transform: translate(0px, 12px);
transform: translate(0px, 12px);
position: absolute;
padding-right: 5px;
padding-left: 5px;
margin-top: 0px;
left: 18px;
line-height: normal !important;
cursor: text;
color: #5f5f5f;
z-index: 1;
}
.selection-box-v2 .co-calendar {
color: #3071a9;
font-size: 20px;
margin-right: 20px;
margin-top: 10px;
position: absolute;
right: 0;
pointer-events: none;
z-index: 1;
}
<div>
Tab is not focusing link 2 in FireFox
</div>
<div class="links-v2">
<a href="javascript:void(0);">
link 1
</a>
</div>
<br>
<div class="col-xs-12 selection-box-v2 pad">
<label tabindex="0" role="radio">
<input type="radio" tabindex="-1" class="shipModeId notVisible" name="shipModeId_1" value="p79652">
<span class="selection-item preferred-arrival-date-v2 inner-addon right-addon calendar-box">
<input class="ship-date" tabindex="-1" type="hidden" value=""/>
<span class="padClause" style="display: none">
<p class="checkout-ship-padClause"> </p>
</span>
<span class="ship-type-and-cost" style="margin-top: 10px;">some other elements
<span class="shipping-cost span-inline calendar-arrival"></span>
</span>
</span>
</label>
</div>
<br>
<div class="links-v2">
<a href="javascript:void(0);">
link 2
</a>
</div>
checked in Firefox 67.0.4 (64-bit)
I've built a modified tab-chart. When you click on the tabs on the left hand side, they switch the content on the right. The only problem is the main content div on the right, even with a width of 100% is only going about a third of the way across the screen. Any ideas why?
* {
padding: 0;
margin: 0;
}
#container {
display: block;
height: 100%;
width: 100%;
}
#topBar1 {
height: 55px;
width: 100%;
background-color: #FAFAFA;
border-bottom: 1px solid #d9d9d9;
display: block;
position: relative;
z-index: 2;
}
#topBar2 {
height: 22px;
width: 100%;
background-color: #FAFAFA;
display: block;
border-radius: 11%;
box-shadow: 0 6px 10px -2.5px #ccc;
position: relative;
z-index: 2;
transition: all;
}
main {
display: block;
background-color: #EEEEEE;
height: 1000px;
width: 100%;
position: relative;
z-index: 1;
top: -5px;
}
nav {
height: 100%;
width: 261px;
}
nav::after {
height: 100%;
width: 1px;
content: "";
display: block;
background: #d9d9d9;
position: relative;
left: 260px;
top: -1000px;
}
input[type=radio] {
display: none;
}
.tabs {
list-style: none;
position: relative;
//border: 1px solid #ccc;
width: 260px;
height: 100%;
top: 15px;
}
.tabs li {
font-family: Roboto, sans-serif;
font-size: 13px;
padding: 10px 20px 20px 60px;
color: #222222;
//border: 1px solid #ccc;
background-color: none;
transition: all .2s ease-in-out;
}
.tabs li:hover {
background-color: #d9d9d9;
}
.tabs li:active {
background-color: #d9d9d9;
}
.tabs label {
display: block;
position: relative;
cursor: pointer;
top: 6px;
}
.tab-content {
position: absolute;
display: none;
z-index: 2;
height: 100%;
width: 100%;
left: 261px;
top: 0;
border: 1px solid #ccc;
}
[id^=tab]:checked~[class^=tab-content] {
display: block;
}
.contentItem {
//border: 1px solid #ccc;
height: 38px;
width: 200px;
margin-left: 10px;
margin-top: 10px;
margin-bottom: 20px;
margin-left: 10px;
background-color: #FAFAFA;
box-shadow: .5px 2px 6px #ccc;
float: left;
}
.documentIcon {
height: 30px;
width: 30px;
border: 1px solid #ccc;
margin: 3px;
margin-left: 5px;
margin-right: 10px;
float: left;
}
.contentText {
font-family: Roboto, sans-serif;
font-size: 12px;
color: #222222;
line-height: 3;
}
<div id="container">
<div id="topBar1"></div>
<!--topBar-->
<div id="topBar2"></div>
<!--topBar2-->
<main>
<nav>
<ul class="tabs">
<li>
<input type="radio" name="tabs" id="tab-1" checked />
<label for="tab-1">Staff Directory</label>
<div class="tab-content" id="tab-content-1">
<div class="contentItem" id="ci1">
<img src="" alt="" class="documentIcon" />
<p class="contentText">Telephone Extension List</p>
</div>
</div>
<!--tab-content-->
</li>
<li>
<input type="radio" name="tabs" id="tab-2" />
<label for="tab-2">How-To Guides</label>
<div class="tab-content" id="tab-content-2">
<p>Put Tab 2 Content here</p>
</div>
</li>
<li>
<input type="radio" name="tabs" id="tab-3" />
<label for="tab-3">OECTA Calendar</label>
<div class="tab-content" id="tab-content3">
<p>Put tab content 3 here</p>
</div>
</li>
<li>
<input type="radio" name="tabs" id="tab-4" />
<label for="tab-4">Finance</label>
<div class="tab-content" id="tab-content-4">
<p>Put tab content for 4 here</p>
</div>
</li>
<li>
<input type="radio" name="tabs" id="tab-5" />
<label for="tab-5">Directories and Contact Lists</label>
<div class="tab-content" id="tab-content-5">
<p>Put Tab 5 content here</p>
</div>
</li>
<li>
<input type="radio" name="tabs" id="tab-6" />
<label for="tab-6">Upcoming Meetings</label>
<div class="tab-content" id="tab-content-6">
<p>Put tab 6 content here</p>
</div>
</li>
<li>
<input type="radio" name="tabs" id="tab-7" />
<label for="tab-7">Manuals and Handbooks</label>
<div class="tab-content" id="tab-content-7">
<p>Tab Content 7</p>
</div>
</li>
<li>
<input type="radio" name="tabs" id="tab-8" />
<label for="tab-8">Information and Forms</label>
<div class="tab-content" id="tab-content-8">
<p>Tab Content 8</p>
</div>
</li>
<li>
<input type="radio" name="tabs" id="tab-9" />
<label for="tab-9">Visitor Information</label>
<div class="tab-content" id="tab-content-9">
<p>Tab Content 9</p>
</div>
</li>
</ul>
</nav>
</main>
</div>
You looking for something like this? https://jsfiddle.net/csgn6051/9/
.tabs
{
width: calc(100% - 270px);
}