How to override all classes within in a media query? - css

I am building a custom .css, but I do not know, how to override a bunch of classes within a media query with "nothing". Means, I do not want this in my output, but also I don't want to delete this from the css as it needs to stay original. I also don't want to copy the whole bunch of classes and write "none" or "unset" behind every single attribute. Is there any solution for this. Thanks a lot.
/*original.css*/
#media only screen and (max-device-width: 720px) {
ol.accord li {
width: 100%;
}
.content {
height: 149px;
width: 50%;
}
ol.accord li h3 {
height: 30px;
width: 100%;
margin: 0;
border-right: none;
border-bottom: 1px solid #fff;
padding: 7px 10px;
}
}
/*custom.css*/
/*here should be nothing like it wouldn´t even exist in the original*/

You can write as many classes in the media query within the parenthesis.
Here is an example for this
Just define the class above and change as per your requirement as per screen size.
.custom_class1 {
height : 1px;
}
#media only screen and (max-device-width: 720px) {
ol.accord li {
width: 100%;
}
.content {
height: 149px;
width: 50%;
}
ol.accord li h3 {
height: 30px;
width: 100%;
margin: 0;
border-right: none;
border-bottom: 1px solid #fff;
padding: 7px 10px;
}
.custom_class1 {
height:70px;
}
.custom_class2 {
height:70px;
}
}

Related

Make page responsive using only CSS

I'm working on a project for a payments company and they require the use of an external page in order to collect payment information.
The only modifications that you can make to this page are supplying a custom CSS file.
There is no meta view port tag on the page, if I add one manually to my browser it works exactly how I want it to, however there is no way to add it to their page since it is controlled by a huge payment company not willing to make any changes.
Is there any way around this? I've tried using the #media tag to my css to change zoom based on screen size since that seems to help, but it doesn't take when I add it to my CSS.
#import url('https://fonts.googleapis.com/css?family=Roboto:300,400,700');
html{
background-color: #2c3745;
}
.PageBody{margin: auto; margin-top: 10px; border-radius: 5px; background-color: white; padding: 30px; max-width: 600px;font-family: 'Roboto', sans-serif;height: auto;min-height: auto;}
.PageContent{ width: auto;color: #000000;margin-left: auto;margin-right: auto;font-size: 14px; }
.ErrorBackground{ border: 1px solid #C79595 !important;background-color: #FAF2F2 !important; }
.ErrorMessage{ margin-bottom: 10px;border: 1px solid #DB9494; padding: 9px 10px 10px 35px; background-color: #FAF2F2;background-image: url("../images/Error.png"); background-position: 10px 10px;background-repeat: no-repeat;border-radius: 4px;-moz-border-radius: 4px;-webkit-border-radius: 4px; }
.RequiredField{color: red;font-size: 13px;float: right;margin-left: 5px;}
.FieldSet{border: 0px solid #D3D3D3;padding: 0;margin-bottom: 0;border-radius: 4px;-moz-border-radius: 4px;-webkit-border-radius: 4px;}
.Legend{padding-left: 0;padding-right: 7px;color: #A3A3A3;display: none;}
.Label{ display: inline-block;padding: 3px 0px 3px 0px;width: 320px;vertical-align: top; }
.TextBox{width: 100%;height: 38px;border: 1px solid #d8d8d8;padding: 0;font-size: 14px;border-radius: 3px;-moz-border-radius: 3px;-webkit-border-radius: 3px;}
.DropDown{width: 300px;height: 40px;border: 1px solid #d8d8d8;padding: 3px;font-size: 14px;border-radius: 2px;-moz-border-radius: 2px;-webkit-border-radius: 2px;}
.LabelColon{padding-left: 3px;display: none;}
.hppFrame {width: 100%;}
.FieldSetOrder{display: none;}
/* IE8, 9 and 10 Specific Styles */
#media screen\0 {
.LegendIe{ display: inline-block;position: relative;top: -20px;left: -3px;background-color: #FFFFFF; }
}
#media screen and (max-width: 648px) {
/* .FieldSet {width: 100%;}*/
.FieldSetOrder .FormRow {margin: 0;}
.FormRightColumn input {width: 100%!important;}
.FormLeftColumn {text-align: left!important;line-height: 23px;}
.Label {width: 100%;}
.FormRightColumn {width: 97%;}
.FormRow {
width: 100%!important;
margin: 0;
}
.FormExpDateMonthField {width: 144px!important;}
.FormExpDateYearField {
width: 145px!important;
}
}
#media screen and (min-width: 649px) {
.FormRightColumn {
width: 62%;
}
.FormRow {
width: 100%;
}
.FormRightColumn input {width: 100%!important;}
}
#btnSubmit {
background-color: #5C9DEC;
color: white;
border: none;
}
#btnCancel {
border: 1px;
color: black;
background-color: white;
border: none;
}
.button {
border-radius: 3px;
margin-top: 10px;
height: 30px;
width: 90px
}
.PageHeader{}
.PageFooter{}
.FormContainer{}
.FieldSetOrder{}
.LegendOrder{}
.FieldsetCreditCard{}
.LegendCreditCard{}
.FieldsetBillingInfo{}
.LegendBillingInfo{}
.FormRow{margin: 0;width: 100%;}
.FormLeftColumn{width: auto;display: inline-block;white-space: nowrap;text-align: left;vertical-align: top;margin-right: 8px;padding-top: 4px;color: #707070;font-weight: bold;clear: both;display: table;font-size: 13px;margin-bottom: 7px;margin-top: 10px;}
.FormRightColumn{/* display: inline-block; */vertical-align: middle;}
.FormAmount{}
.FormAmountLabel{}
.FormAmountValue{}
.FormAmountField{
font-weight: bold;
}
.FormInvoice{}
.FormInvoiceLabel{}
.FormInvoiceValue{}
.FormInvoiceField{}
.FormComment1{}
.FormComment1Label{}
.FormComment1Value{}
.FormComment1Field{}
.FormComment2{}
.FormComment2Label{margin-bottom: 7px;}
.FormComment2Value{margin-bottom: 7px;}
.FormComment2Field{}
.FormName{}
.FormNameLabel{}
.FormNameLabel1{color: #BEBEBE;font-weight: normal;font-style: italic;}
.FormNameValue{}
.FormNameField{}
.FormCardNumber{}
.FormCardNumberLabel{}
.FormCardNumberValue{}
.FormCardNumberField{}
.FormExpDate{}
.FormExpDateLabel{}
.FormExpDateValue{}
.FormExpDateMonthField{width: 177px;}
.FormExpDateYearField{width: 178px;}
.FormCvv{}
.FormCvvLabel{}
.FormCvvValue{}
.FormCvvField{ width: 95px; }
.FormDescription{
display: none;
}
.FormDescriptionLabel{}
.FormDescriptionValue{}
.FormDescriptionField{}
.FormAddress1{}
.FormAddress1Label{}
.FormAddress1Value{}
.FormAddress1Field{}
.FormAddress2{}
.FormAddress2Label{}
.FormAddress2Value{}
.FormAddress2Field{}
.FormCity{}
.FormCityLabel{}
.FormCityValue{}
.FormCityField{}
.FormState{}
.FormStateLabel{}
.FormStateValue{}
.FormStateField{}
.FormStateDropDown{}
.FormZip{}
.FormZipLabel{}
.FormZipValue{}
.FormZipField{ width: 95px; }
.FormCountry{}
.FormCountryLabel{}
.FormCountryValue{}
.FormCountryField{}
.FormBankAccountType{}
.FormBankAccountTypeLabel{}
.FormBankAccountValue{}
.FormRadioButtonField{}
.FormBankAccountNumber{}
.FormBankAccountNumberLabel{}
.BankAccountNumberNumberValue{}
.FormBankAccountNumberField{}
.FormBankRoutingNumber{}
.FormBankRoutingNumberLabel{}
.BankRoutingNumberNumberValue{}
.FormBankRoutingNumberField{}
.AcceptOnlyNumbers{}
.input-validation-error { }
.field-validation-error { display: table }
.field-validation-valid { display: none }
.validation-summary-errors { display: none }
.validation-summary-valid { display: none }
.FormBankAccountValue input[type="radio" i] {
width: 20px !important;
height: 10px;
}
.FormBankAccountValue label {
width: 50%;
float: left;
margin: 5px 0;
}
You have to find the CSS elements which are preventing the page from responding in the vanilla HTML and overwrite them in your CSS file.

Why doesn't this CSS get scoped by vue.js?

Inside a Vue single file component I have a scoped style section that looks like this:
<style scoped>
#media screen and (max-width: 767px) {
#suggestions, #form, #mapcontainer, #searchcontainer {
width: 100%; padding: 6px;
}
#mapcontainer div#mapx {
height: 400px
}
}
#media screen and (min-width: 768px) {
#workarea {
display: grid;
grid-template-columns: 1.5fr 1fr;
}
#mapcontainer {
grid-column: 1;
}
.blurb {
grid-column: 2;
margin-left: 12px;
}
#mapcontainer div#mapx {
height:600px;
width: 100%;
}
}
#suggestions tr { border-bottom: thin solid silver; }
#suggestions td { padding: 6px 3px 6px 3px }
#suggestions table { margin-bottom: 12px }
</style>
After checking the rendered source in Chrome's inspector I see the data tag in the rendered component like this:
<div data-s-0="" id="appspace">
but I don't see any of the expected changes to the CSS as documented in the section about scoped CSS in the vue.js docs
It seems to happen every time the scoped style contains a #media query.
What do I need to change so that styles stay scoped?

How to contain feed items from overflowing into next column

I'm using WP RSS Aggregator, and I've styled the feed into containers, along with creating a 3 column layout. Limiting the feeds to 18 per page, I'm experiencing overflow issues. Setting the CSS to overflow:hidden !important; has not resolved the issue. Being the length of each feed item varies, I'm hoping for a solution that will carry through each feed category. Below is a link to the feed page, followed by the CSS I've implemented for feed imports into their respective pages. Thank you in advance for your help.
enter image description here
div.wprss-et-social-buttons {
display: none;
}
.thumbnail-excerpt img{
float: none !important;
}
.thumbnail-excerpt {
text-align: center;
}
li.feed-item{
overflow: hidden !important;
border: solid #000 2px;
border-radius: 5px;
padding: 10px;
width: 250px;
background: #eee;
}
.thumbnail-excerpt {
overflow: auto !important;
}
wprss-feed-excerpt{
font-size: 16px;
text-align: center;
}
li.feed-item > a{
font-size: 23px;
text-align: center;
}
ul.rss-aggregator{
column-count: 3 !important;
list-style-type: none;
}
#media only screen and (max-width: 980px) {
ul.rss-aggregator {
column-count: 2 !important;
}
}
#media only screen and (max-width: 479px) {
ul.rss-aggregator {
column-count: 1 !important;
}
}

Responsive CSS iPhone etc

Hi for some reason my responsive CSS is not working, I'm not sure what to change or what to do, but whenever I load my site up on my iPhone and zoom all the way out the site only uses up approx 3/4 of the page, I have no idea why, here's the code in my CSS.
#media (max-width:767px) {
.navbar-custom .nav.navbar-nav {
background-color: rgba(255,255,255,.4);
}
.navbar.navbar-custom.navbar-fixed-top {
margin-bottom: 30px;
}
.tp-banner-container {
padding-top:40px;
}
.page-scroll a.btn-circle {
width: 40px;
height: 40px;
margin-top: 10px;
padding: 7px 0;
border: 2px solid #fff;
border-radius: 50%;
font-size: 20px;
}
}
I've the max width to 767 as that's the width of a iPhone to test it out, but no matter what I seem to change nothing happens.

#media queries not applying some styles

I have the following media query which applies the background style to the body successfully, however it does not change the others, any ideas pleople?
#media (min-width: 980px) and (max-width: 1200px) {
body {
background:#F00;
}
.contentsearch.navbar {
    margin-left: -475px !important;
    top: 200px !important;
    width: 950px !important;
}
.contentTabs {
    margin-left: -475px !important;
    width: 948px !important;
}
.ui-tabs-panel { 
width: 948px !important;
}
}
heres the original css for these elements
.contentsearch.navbar {
position:absolute;
top:200px;
width:1170px;
left:50%;
margin-left:-585px;
}
.contentTabs {
border-bottom: 1px solid #AAAAAA;
border-left: 1px solid #AAAAAA;
border-right: 1px solid #AAAAAA;
bottom: 55px;
height: auto !important;
left: 50%;
margin-left: -585px;
position: absolute !important;
top: 241px;
width: 1168px;
}
.ui-tabs-panel {
border-bottom: 1px solid #DDDDDD !important;
border-top: 1px solid #CCCCCC !important;
bottom: -1px !important;
height: auto !important;
overflow: auto;
position: absolute !important;
top: 47px !important;
width: 1168px;
}
Try with this :
#media all and (min-width: 980px) and (max-width: 1200px){
....
}
You forgot declared on what type of screen you want it to be active
#media all and.....
You have :
all
screen
print
handheld
tv
etc..
You have excellent article for this
Without media type it works anyway.
If you resize browser nothing happens?
Original css should be displayed when your screen size has more than 980px, correct?
I have solved the issue, thanks for your responses.
The problem was i was copy and pasting styles from another application, in transit them seem to have picked up some kind of strange formatting/characters, after rewriting them by hand it now works!

Resources