Jump to content

HTML/ CSS/ JScript Issue

@media screen and (max-width: 960px) {    #advert {        display: none;    }}

This uses CSS3 only, so this goes in your styles. Given that it's CSS3 though, some particularly terrible browsers might now handle it. But most/all phone browsers should and that's all that really matters

 

EDIT: See basic working example here http://h125.co/f9d

I am good at computer

Spoiler

Motherboard: Gigabyte G1 sniper 3 | CPU: Intel 3770k @5.1Ghz | RAM: 32Gb G.Skill Ripjaws X @1600Mhz | Graphics card: EVGA 980 Ti SC | HDD: Seagate barracuda 3298534883327.74B + Samsung OEM 5400rpm drive + Seatgate barracude 2TB | PSU: Cougar CMX 1200w | CPU cooler: Custom loop

Link to comment
https://linustechtips.com/topic/285676-html-css-jscript-issue/#findComment-3879582
Share on other sites

Link to post
Share on other sites

I would also go with an CSS3 only solution! Use a Media Query:

@media screen and (max-width: 960px){   #advert{      position: absolute;      top:  -9999px;      left: -9999px;   }}

By using this solution, you keep the Media Accessible for ScreenReaders. If you use display:none, the media will be ignored by screen readers.

Business Management Student @ University St. Gallen (Switzerland)

HomeServer: i7 4930k - GTX 1070ti - ASUS Rampage IV Gene - 32Gb Ram

Laptop: MacBook Pro Retina 15" 2018

Operating Systems (Virtualised using VMware): Windows Pro 10, Cent OS 7

Occupation: Software Engineer

Link to comment
https://linustechtips.com/topic/285676-html-css-jscript-issue/#findComment-3879685
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×