Background portion not covered by pseudo elements - css

I get a strange behaviour in IE (11) and Edge (25) with a line showing on top of pseudo elements (before and after) in a div. On the left is what it is supposed to look like (and does so in Chrome and Firefox), on the right you have IE and Edge:
Note: This only occurs on "not full" resolutions. So, any resolution wider than 1300px is not containing that border.
EDIT: I narrowed it down to the transform. The line only appears with a skewed element.
I have the following html structure:
<div class="col-xs-12 col-md-3 rightcontent">
<div class="halfcolumn hcblue">
<div class="hchlwrapper">
<div class="hcheadline">NEWS</div>
</div>
...
</div>
</div>
The stylings are the following (scss):
/* Colors */
$red: #FF0000;
$green: #00FF22;
$yellow: #FFF700;
$black: #000000;
$blackrgba: rgba(0,0,0,0.5);
$grey: #D7D7D7;
$greydark: #808080;
$lightgrey:#EcEBEB;
$white: #FFFFFF;
$bluelight: #6882B5;
$darkblue: #003399;
$ikbblue: #003399;
$ikbgreen: #B2D84C;
/* Heights, widths */
$full-width: 1300px;
$large-width: 1200px;
$desktop-width: 992px;
$medium-width: 768px;
$small-width: 576px;
$min-width: 320px;
.halfcolumn{
padding-right: 25px;
padding-bottom: 25px;
overflow: hidden;
.hcheadline{
font-weight: bold;
text-align: center;
padding: 15px 0 15px 0px;
color: $ikbgreen;
overflow: hidden;
#media (min-width: $full-width){
font-size: 30px;
margin-right: 40px;
}
#media (min-width: $large-width) and (max-width: 1299px){
font-size: 30px;
margin-right: 20px;
}
#media (min-width: $desktop-width) and (max-width: 1199px){
font-size: 22px;
margin-right: 20px;
}
#media (min-width: $medium-width) and (max-width: 991px){
font-size: 15px;
margin-right: 8px;
}
#media (min-width: 468px) and (max-width: 767px){
font-size: 22px;
margin-right: 130px;
}
#media (min-width: 380px) and (max-width: 467px){
font-size: 14px;
margin-right: 90px;
}
#media (max-width: 379px){
font-size: 14px;
margin-right: 60px;
}
}
.hchlwrapper{
position: relative;
z-index: 1;
overflow: hidden;
}
.hchlwrapper:before{
content: '';
position: absolute;
background-color: $white;
width: 100%;
height: 100%;
left: -10%;
top: 0px;
-webkit-transform: skew(-20deg,0deg);
-moz-transform: skew(-20deg,0deg);
transform: skew(-20deg,0deg);
z-index: -1;
#media (min-width: $desktop-width) and (max-width: 1199px){
left: -11%;
}
#media (min-width: $medium-width) and (max-width: 991px){
left: -13%;
}
#media (min-width: 468px) and (max-width: 767px){
left: -7%;
}
#media (min-width: 370px) and (max-width: 467px){
left: -8%;
}
#media (max-width: 369px){
left: -9%;
}
}
.hchlwrapper:after{
content: '';
position: absolute;
background-color: $white;
left: 88%;
width: 9%;
height: 35%;
top: 0%;
z-index: -1;
-webkit-transform: skew(-20deg,0deg);
-moz-transform: skew(-20deg,0deg);
transform: skew(-20deg,0deg);
}
.hccontent{
padding-left: 25px;
}
}
.hcblue{
background-color: $ikbblue;
color: $white;
}
.hcgreen{
background-color: $ikbgreen;
color: $white;
}
.hcgray{
background-color: $greydark;
color: $white;
}
}

After all, the best solution I found for this buggy behaviour was a little "workaround":
get rid of overflow: hidden in the class halfcolumn and hchlwrapper
in the ":before"-part: height to 101%, top to -1%, do similar changes to the ":after"-element
This way, I had to give up the comfort of hidden overflows, but it looks fine now.

Related

How to fix this ui using media queries?

I thought like it is overlapping media queries issues but I didn't find any media query which overlaps.
I resize the width of menucontainer and searchcontainer but didn't work.
I thought it was that searchcontainer which has more size in padding,I tried to decrease and increase the padding value of searchcontainer but it didn't work.
4.When I click on 'Toggle device toolbar' it is not showing any dislocation of this three container(searchcontainer,contactcontainer and menucontainer) but when I remove 'Toggle device' option that time on chrome view it is dislocated their positions.
This dislocation occurs in between 786px to 771px width.
I want both side same view and this view can be supported all devices including desktop, tablets .
Click here to understand my code
Here is my code
`
#media only screen and (min-device-width : 768px) and (max-device-width : 768px), (min-width: 768px) and (max-width: 768px) and (orientation: landscape) {
.MenuContactContainer {
max-width: 100%;
width: 100%;
vertical-align: top !important;
padding-right: 0px;
text-align: center !important;
}
.MenuContact {
margin-bottom: 0px;
margin-top: 0px;
vertical-align: central;
padding-right: 10px;
font-weight: 400;
font-size: large;
text-align: center !important;
}
.search-container {
width: 102% !important;
display: inline-block;
height: 55px;
margin-left: 0px !important;
}
.Hamburger {
z-index: 257;
width: 465px;
height: 41px;
padding-bottom: 4px;
margin-left: 16px;
margin-right: auto;
margin-top: -53px;
position: relative;
border-color: transparent;
opacity: 1;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
filter: alpha(opacity=100);
background: transparent url(../images/hamburger.png) no-repeat center center;
background-size: contain;
}
.searchtextbox {
height: 32px;
background-color: #EAB640;
padding-left: 10px;
margin-top: -2px;
margin-bottom: 18px;
vertical-align: middle;
width: 270px;
margin-left: 32px;
}
}
`
How can I solve this issue? Please me find out that issue.
This is dislocation of three components are here.
This is showing in 'Toggle device' mode which is right position.

How to do media queries without affecting other media queries

I am a bit confused here... I found some common breakpoints to use for my css media query but am only using max-width such as #media screen and (max-width: 812px) {} etc but it seems to be moving my other media queries around. I thought that this should only affect the code that is 812px or less. Do I need to add both a min-width and max-width to solve the issue ?
#media only screen and (max-width: 50em) and (orientation: portrait) {
label {
width: 100%;
display: block;
position: relative;
}
.nav {
width: 200%;
}
#nav-icon {
font-size: 28px;
line-height: 50px;
padding-left: 1em;
color: #ffffff;
background-color: #f44336;
}
div.nav ul, div.nav li, label{
line-height: 50px;
margin: 0;
padding: 0 2em;
list-style: none;
text-decoration: none;
color: #000;
font-weight: 100;
width: 150%;
position: relative;
font-size: .9em;
}
div.header2_welcome h1{
text-align: center;
font-family: 'Pacifico', cursive;
font-size: 1em;
position: absolute;
top: 5em;
left: 0em !important;
text-decoration: none;
white-space: nowrap;
}
img.pc101 {
width: 20em;
height: 7em;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
position: absolute;
top: 27em;
margin-left: -15em;
font-size: .8em;
}
div.natural {
font-size: 150px;
position: relative;
right: .5em;
top: 2em;
animation: drop 2s ease forwards;
margin-bottom: 1em;
}
div.flat {
font-size: 150px;
position: relative;
left: 1200px;
bottom: 450px;
top: 8em;
}
div.treble_clef {
font-size: 100px;
position: relative;
right: 400px;
bottom: 400px;
}
div.crotchet_rest {
font-size: 6em;
position: relative;
left: 100px;
bottom: 800px;
}
div.crotchet {
font-size: 6em;
position: absolute;
left: 3.5em !important;
top: 3em;
animation: drop 2s ease forwards;
}
div.minim {
font-size: 6em;
position: absolute;
left: 1.5em;
top: 2em;
animation: drop 2s ease forwards;
}
}
This is only a sample of my code but don't know it is moving my other media queries around..
I think the following code will help you.
<style>
#media only screen and (max-width:768px) and (min-width:200px)
{
/* Your CSS Code */
}
</style>
The media query may have a lots of condition
only for screen of less than 500px
#media only screen and (max-width:500px)
only for screen between 200px and 500px
#media only screen and (min-width:200px) and (max-width:500px)
only for screen more than 500px
#media only screen and (min-width:500px)
only for screen on every size
#media only screen
only for print on every size
#media only print
only for sqare screen
#media (aspect-ratio: 1/1)
only for sqare screen
#media (aspect-ratio: 1/1)
only for screen of aspect ratio superior to : 16/9
#media (-max-aspect-ratio: 16/9)
ecc.. you can specify pixel-ratio or dpi to better fit your need

CSS problem with tag #media, adaptation position of the button

On the page https://sport-print.online/sample-page/ I have a little button "Сравнить". I'm trying to adapt it using the CSS code:
#media only screen and (max-width: 1920px), only screen and (max-device-
width: 1920px) {
.compare
{
right: -500px;
top: -720px;
width: 70px;
height: 30px;
line-height: 20px;
padding: 0 10px !important;
padding-right: 20px !important;
padding-bottom: 10px !important;
}
}
#media only screen and (max-width: 1024px), only screen and (max-device-
width: 1024px) {
.compare
{
right: -300px;
top: -320px;
width: 70px;
height: 30px;
line-height: 20px;
padding: 0 10px !important;
padding-right: 20px !important;
padding-bottom: 10px !important;
}
}
Only the first part of the code works for width in 1920px. The second part of the code does not work. When the resolution is changed, the button position is not switched. Prompt please in what my error? Please correct my code.
Problem solved, the top and right properties do not affect position: static;
It was necessary to specify position: absolute; or position: relative; in the #media properties. Operating code:
.compare
{
width: 70px;
height: 30px;
line-height: 20px;
padding: 0 10px !important;
padding-right: 20px !important;
padding-bottom: 10px !important;
}
#media only screen and (max-width: 1920px), only screen and (max-device-width:
1920px) {
.compare
{
position: absolute; /* или position: relative;*/
right: -500px;
top: -720px;
}
}
#media only screen and (max-width: 1024px), only screen and (max-device-width:
1024px) {
.compare
{
position: absolute; /* или position: relative;*/
right: -300px;
top: 700px;
}
}

How can I make this header look better on mobile devices?

https://blendbee.com
This is a WordPress site. The top part of the header needs some styling improvements for smaller screen sizes:
Center the logo
Some padding or margin above the logo (so it doesn't touch the top bar)
Less whitespace above and below the menu icon
Here's the current HTML code:
<div class="header-wrap">
<header id="header" class="site-header " role="banner">
<div class="row">
<div class="large-12 small-12 columns">
<div class="logo">
<a href="https://blendbee.com/" title="BlendBee – Your Tea. Your Way." rel="home">
<img data-interchange="[https://blendbee.com/wp-content/uploads/2014/06/BlendBee-Logo-and-Tagline-2.png, (default)], [https://blendbee.com/wp-content/uploads/2014/06/BlendBee-Logo-and-Tagline-2.png, (retina)]" alt="" class="hideie" data-uuid="60a3bc00-c94c-c4ba-258c-a9faa107e418" src="https://blendbee.com/wp-content/uploads/2014/06/BlendBee-Logo-and-Tagline-2.png">
<img src="https://blendbee.com/wp-content/uploads/2014/06/BlendBee-Logo-and-Tagline-2.png" alt="" class="ie">
<noscript><img src='https://blendbee.com/wp-content/uploads/2014/06/BlendBee-Logo-and-Tagline-2.png' alt='BlendBee &#8211; Your Tea. Your Way.'></noscript>
</a>
</div>
<div id="mobile-menu-button" class="show-for-small">
<a class="secondary button" id="mobileMenuButton" href="#mobile-menu">
<span class="mobile-menu-icon"></span>
<span class="mobile-menu-icon"></span>
<span class="mobile-menu-icon"></span>
</a>
</div>
</div>
</div>
</header>
</div>
And related CSS:
#media screen and (max-width: 767px) {
.mix.half.mix_all {
width: 50%;
float: left;
}
.mix.mix_all {
width: 100%;
}
.sidebar.large-3.small-12.columns {
width: 100%;
float: none;
}
#soc-icons-wrap.closed {
margin-bottom: 20px;
height: 50px;
}
.large-6.small-12.columns p{
width: 100% !important;
}
#header.scroll-to-fixed {
position: static;
}
}
#mobile-menu-button .button {
margin-bottom: 0;
padding: 0.75em 0.5em;
width: auto
}
.mobile-menu-icon {
background: #fff;
height: 0.25em;
width: 2.5em;
display: block;
}
.mobile-menu-icon + .mobile-menu-icon {
margin: 0.25em 0 0
}
#media only screen and (min-width: 767px) {
body.admin-bar #header.scroll-to-fixed {
top: 32px;
}
}
#media only screen and (max-width: 767px) {
.logo {
float: none;
text-align: center;
}
#header.scroll-to-fixed {
position: static !important;
height: auto;
width: auto;
border-bottom: none;
}
#header.scroll-to-fixed .logo {
width: 300px;
padding-top: 20px;
position: static;
top: 0;
margin: 0 auto;
}
#header.scroll-to-fixed .logo img {
max-height: 140px;
width: 100%;
-webkit-transition: none;
-moz-transition: none;
transition: none;
}
#mobile-menu .tiled-menu {
float: none;
margin: 0;
padding: 0;
}
#mobile-menu .main-menu-item {
float: none;
width: 100% !important;
}
#mobile-menu .menu-tile {
height: 60px !important;
background-image: none !important;
}
#mobile-menu .item-title,
#mobile-menu .tiled-menu > .menu-item-language > a {
top: 5px;
font-size: 20px;
left: 25px;
}
#mobile-menu .tile-icon,
#mobile-menu .tiled-menu > .menu-item-language:before {
right: 10%;
width: auto;
}
#mobile-menu .tiled-menu > .menu-item-language {
height: 60px !important;
}
#mobile-menu .style-metro .sub-menu {
padding-top: 3px;
}
}
#media only screen and (min-width: 640px) and (max-width: 1024px) {
.tiled-menu .sub-menu {
position: absolute;
}
.tiled-menu {
text-align: center;
}
.main-menu-item {
text-align: left;
}
.tiled-menu .metro-menu-item .sub-menu {
position: absolute;
}
}
wrapper i {
margin: 84px 0 0 110px;
}
.entry-header .entry-meta .entry-tags {
margin-left: 0;
}
.large-12.small-12.columns .large-8.small-12.columns .large-6.small-12.columns {
position: relative;
top: 12px;
}
.large-12.small-12.columns .large-8.small-12.columns .large-3.small-12.columns .answer {
width: 33%;
margin-top: 20px;
}
.large-12.small-12.columns .large-8.small-12.columns .large-3.small-12.columns .answer input {
padding: 18px 5px;
}
.large-12.small-12.columns .large-8.small-12.columns .large-3.small-12.columns {
width: 13%;
margin-top: 20px;
}
.large-12.small-12.columns .large-8.small-12.columns .large-3.small-12.columns.answer{
width: 33%;
margin-top: 20px;
}
.site-header {
border-bottom: none;
}
ol ul, ul ol, ul ul, ol ol {
-webkit-margin-before: 0px;
-webkit-margin-after: 10px;
}
.large-12.small-12.columns .large-8.small-12.columns .large-6.small-12.columns p {
float: left;
width: 70%;
text-align: left;
margin-top: 0;
}
#media only screen and (min-width: 320px) and (max-width: 767px) {
.tiled-menu {
left: -3px !important;
}
.tiled-menu>li>ul {
padding-top: 0;
}
}
#media screen and (max-width: 320px) {
.large-12.small-12.columns .large-8.small-12.columns .large-6.small-12.columns{
text-align: center;
}
.large-12.small-12.columns .large-8.small-12.columns .large-3.small-12.columns{
margin-left: 28%;
margin-top: 0;
width: 52%;
}
.large-12.small-12.columns .large-8.small-12.columns .large-3.small-12.columns.answer{
margin-top:0 ;
}
.large-3.small-12.columns input{
width: 145px;
}
}
#media screen and (min-width: 321px) and (max-width: 480px) {
.large-12.small-12.columns .large-8.small-12.columns .large-6.small-12.columns{
text-align: center;
}
.large-12.small-12.columns .large-8.small-12.columns .large-6.small-12.columns{
text-align: center;
}
.large-12.small-12.columns .large-8.small-12.columns .large-3.small-12.columns{
margin-left: 36%;
margin-top: 0;
width: 35%;
}
.large-12.small-12.columns .large-8.small-12.columns .large-3.small-12.columns.answer{
margin-top:0 ;
}
.large-3.small-12.columns input{
width: 148px;
}
}
#media screen and (min-width: 480px) and (max-width: 800px) {
.site-header .logo {
margin: 0 auto 20px;
}
.site-header.scroll-to-fixed .logo {
margin: 0;
}
}
#media screen and (min-width: 481px) and (max-width: 568px) {
.large-12.small-12.columns .large-8.small-12.columns .large-6.small-12.columns{
text-align: center;
}
.large-12.small-12.columns .large-8.small-12.columns .large-3.small-12.columns{
margin-left: 38%;
margin-top: 0;
width: 30%;
}
.large-12.small-12.columns .large-8.small-12.columns .large-3.small-12.columns.answer{
margin-top:0 ;
}
.large-3.small-12.columns input{
width: 149px;
}
}
#media screen and (min-width: 569px) and (max-width: 600px) {
.category-submenu .sub-nav .sub-nav dd {
margin-left: 0.8rem !important;
margin-bottom: 0;
}
.mix .entry-thumbnail img {
width: 100% !important;
}
.large-12.small-12.columns .large-8.small-12.columns .large-6.small-12.columns{
text-align: center;
}
.large-12.small-12.columns .large-8.small-12.columns .large-3.small-12.columns{
margin-left: 38%;
margin-top: 0;
width: 28%;
}
.large-12.small-12.columns .large-8.small-12.columns .large-3.small-12.columns.answer{
margin-top:0 ;
}
.large-3.small-12.columns input{
width: 148px;
}
.pricetable-column {width: 50% !important;}
}
#media screen and (min-width: 768px) and (max-width: 800px) {
.large-12.small-12.columns .large-8.small-12.columns .large-6.small-12.columns p{
float: left;
width: 56%;
text-align: left;
margin-top: 0;
}
.large-12.small-12.columns .large-8.small-12.columns .large-3.small-12.columns {
width: 13%;
margin-top: 20px;
}
.large-12.small-12.columns .large-8.small-12.columns .large-3.small-12.columns.answer{
width: 26%;
margin-top: 20px;
}
}
#media screen and (min-width: 768px) and (max-width: 1000px) {
.logo {
float: none;
margin: 0 auto;
}
#header.scroll-to-fixed .logo {
display: none;
}
.main-menu-item {
display: inline-block;
margin-left: 0;
float: none;
text-align: left;}
.tiled-menu {
float: none;
text-align: center;
}
}
#media screen and (min-width: 640px) and (max-width: 767px) {
.tiled-menu>li>ul {
padding-top: 25px;
}
}
If anyone can help, I'd be much appreciative - thanks :)
First - Try using this code for centering your logo and adding some padding to the top:
.logo {
padding-top: 50px;
width: 280px;
margin: auto;
}
Enter this code in the "Custom CSS" part when you open your customizer.
Second - This code for removing some white space below your menu icon:
#mobile-menu-button {float: none;text-align: center;}
Replace this part in the responsive.min.css file.
Third - This code for removing some white space above your menu icon:
#mobile-menu-button {
margin: 1rem 0 0;
}
Replace this part in the foundation.css file.
As you will see, it works:

Style Not Being Applied After Media Query?

.row {
margin-bottom: 0px;
}
is not being applied but when I remove the second media query it is?
Design was desktop by default and now trying to implement mobile and tablet.
body {
background-image: url('../images/iStock-527528428 Cropped.jpg');
background-repeat: no-repeat;
background-position: center top;
/*background-attachment: fixed;*/
color: white;
}
.container {
width: 37%;
background-color: black;
background: rgba(0, 0, 0, 0.67);
border-radius: 17px;
padding: 17px;
position: relative;
top: 37px;
}
#media screen and (max-width: 600px) {
.container {
width: 85%;
top: 24px;
}
body {
background-position: left top;
}
}
#media screen and (min-width: 601px) and (max-width: 992px) {
.container {
width: 55%;
top: 24px;
}
}​
.row {
margin-bottom: 0px;
}
html {
font-family: 'Nunito', sans-serif;
}
By default bootstrap has no margin at bottom of .row class.

Resources