未加星标

Div css style does not respond to media request for width

字体大小 | |
[数据库(综合) 所属分类 数据库(综合) | 发布者 店小二03 | 时间 2019 | 作者 红领巾 ] 0人收藏点击收藏

I have a div I created that I am using for a subscribe button. This div is responding perfectly to my desktop CSS, but it isn't responding to my commands in my media query.

I have set the width to many different things and it fully takes up the entire page and messes up the rest of my page by making it extend past where the right margin would normal end.

This is the div that I am having issues with.

<div class="subscribebutton" onmouseover="this.style.background='#12BDB8';" onmouseover="this.style.color='white';" onmouseout="this.style.background='transparent';"> <a href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'">Subscribe</a> </div>

It is inside of a content wrapper I created..

<div class="newsletter-content"> <div class="centermailimg"><img src="/images/mailicon.png" alt="mail"></div> <p class="subscribecolortext">Get up-to-date news and special deals sent to your inbox</p><br> <p class="subscribebodytext">We want to hear from you, let us know what we can do to make your experience better!</p> <br><br> <div class="subscribebutton" onmouseover="this.style.background='#12BDB8';" onmouseover="this.style.color='white';" onmouseout="this.style.background='transparent';"> <a href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'">Subscribe</a> </div> <div id="light" class="newsletterenvelope"><a class="close" href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'">Close</a> <form id="newsletterform" action="" method="POST"> <span class="spanlargefont"><span class="spancenter">Subscribe To Our Newsletter</span></span> <div class="floatrightinline"><p>Subscribe to our newsletter to receive special promotions and get up to date news about BuyFarBest.</p></div> <div class="center"> <input class="inputbarcenter" name="name" placeholder="Name" type="text" required><br> <input class="inputbaremailcenter" name="email" placeholder="Email Address" type="email" required><br><br><br> <input id="newssubmit" name="submit" type="submit" value="Subscribe" a href = "javascript:void(0)" onclick = "document.getElementById('lightone').style.display='none';document.getElementById('fadeone').style.display='none'"></a> </div> </form> </div> <div id="fade" class="black_overlay"></div> <div id="lightone" class="newsletterthankyou"><a href = "javascript:void(0)" onclick = "document.getElementById('lightone').style.display='none';document.getElementById('fadeone').style.display='none'">Close</a> <span class="spanlargefont"><span class="spancenter">Thanks for subscribing!</span></span> <p class="center">It won't be long before you start getting awesome deals sent to your inbox.</p> </div> <div id="fadeone" class="black_overlay"></div> <br> </div>

This is the normal desktop CSS that works perfect.

.subscribebutton { width: 350px; padding: 20px; border-radius: 15px; border: 2px solid #12BDB8; background-color: transparent; color: #12BDB8; font-size: 1.5em; font-weight: bold; cursor: pointer; margin: auto; text-align: center; } .subscribebutton a { text-decoration: none; outline: none; color: #12BDB8; width: 100%; } .subscribebutton a:hover { height: 100%; width: 100%; color: #FFFFFF; -webkit-transition: color 300ms ease-in 200ms; /* property duration timing-function delay */ -moz-transition: color 300ms ease-in 200ms; -o-transition: color 300ms ease-in 200ms; transition: color 300ms ease-in 200ms; } .subscribebutton:hover { background-color: #12BDB8; color: #FFFFFF; -webkit-transition: background 300ms ease-in 200ms; /* property duration timing-function delay */ -moz-transition: background 300ms ease-in 200ms; -o-transition: background 300ms ease-in 200ms; transition: background 300ms ease-in 200ms; }

Then the media query CSS

.subscribebutton { width: 100px; padding: 15px; border-radius: 15px; border: 2px solid #12BDB8; background-color: transparent; color: #12BDB8; font-size: 1.5em; font-weight: bold; cursor: pointer; margin: auto; text-align: center; } .subscribebutton a { text-decoration: none; outline: none; color: #12BDB8; } .subscribebutton a:hover { height: 100%; color: #FFFFFF; -webkit-transition: color 300ms ease-in 200ms; /* property duration timing-function delay */ -moz-transition: color 300ms ease-in 200ms; -o-transition: color 300ms ease-in 200ms; transition: color 300ms ease-in 200ms; }

Is there something I have over-looked? I've been stuck on this forever.

To see this you can visit the site it is on at buyfarbest.com . It's on the index page.

Your css rule for '.footerbar li a' on line 2392 of your Style.css file is missing a closing brace. That is what is causing some of your media query css to be ignored.

You have:

.footerbar li a { padding-top: 15px; color: #CCCCCC; padding: 0px 100px 0px 0px; position: relative; font-size: 0.7em; font-family: Helvetica; text-decoration: none; outline: none;

It should be:

.footerbar li a { padding-top: 15px; color: #CCCCCC; padding: 0px 100px 0px 0px; position: relative; font-size: 0.7em; font-family: Helvetica; text-decoration: none; outline: none; }

本文数据库(综合)相关术语:系统安全软件

代码区博客精选文章
分页:12
转载请注明
本文标题:Div css style does not respond to media request for width
本站链接:https://www.codesec.net/view/628022.html


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 数据库(综合) | 评论(0) | 阅读(90)