responsive-design

Change website design for mobile devices or browser resize

放肆的年华 提交于 2019-12-09 18:33:54
问题 Im sorry if this has been asked before im sure somewhere there must be an answer for this but for some or other reason I cant find it, probably using wrong search query I know you can use media queries to target different devices like so: @media only screen and (max-device-width: 480px) { div#wrapper { width: 400px; } } But what I would like to know is, how to change my websites design based on device it is viewed on? Example Lets say my normal site structure is like this: if desktop <div id=

percentage max-height on image ignored in firefox

不羁岁月 提交于 2019-12-09 15:55:29
问题 HTML: <div class="container"> <article class="article"> <img class="article-img" src="bordeaux.jpg" /> </article> </div> CSS: .container{ width:500px; height:200px; } .article{ max-height:100%; } .article-img{ max-height:100%; } see its jsfiddle in Firefox http://jsfiddle.net/UETMr/4/ I needed to set .article to height:100% for image to shrink in Firefox can someone explain how does firefox understand percentage max-height and its containers ? thanks in advance ! 回答1: It understands it the

Responsive CSS circles that can hold centered content

廉价感情. 提交于 2019-12-09 13:13:36
问题 I am searching for a way to create a responsive CSS3 circle that can hold centered content. Regarding the circle, I found some good info in this question. Too bad it seems that one can't center the content in this one. This question is also pretty similar to mine, despite the fact it's an image that should be centered. Using a background image in not an option in my case, so this option isn't working for me as well. Do you have any ideas how I could approach this? Of course I could use an

Where to put CSS3 media queries?

若如初见. 提交于 2019-12-09 11:50:55
问题 I am having a philosophical debate with myself over the best place to put media queries within style sheets. I am attempting to structure my CSS modularly (like OOCSS or SMACSS, etc). Given that context, I see two choices: Put all media queries together in a separate stylesheet or section of the main stylesheet. Put media queries below their base counterparts. For example, if I have a module called "news-item", I could put any necessary media query styles right below the definition of that

Make background image responsive

天涯浪子 提交于 2019-12-09 10:10:20
问题 I want to make background image responsive both in width as well as in height so that i can run it in mobile. I have used this .your_background_class_name { width: 100%; height:auto; top: 0px; left: 0px; z-index: -1; position: absolute; } but it works in width only not in height. What changes should i do to make it work? 回答1: html { background: url(https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcSvctt0I--skoKQVfuVt-i4Et6vQ5ve7lXPkLy9sTElCWLKh1Ps) no-repeat center center fixed; -webkit

Bootstrap 3 responsive h1 tag

梦想与她 提交于 2019-12-09 08:58:35
问题 I am creating a site and want it to be responsive so I am using bootstrap 3. However, the h1 tag on the privacy policy page and about page come out of the container on small mobile devices since the word is too large. Is there a way I can make the h1 tag reduce in size to fit in the container on smaller mobile devices ? The site is muscadinewinerecipe.com if anyone wants to view what I'm talking about. It's the about page and privacy policy page. 回答1: You can use this : CSS : h1{ word-wrap:

Twitter Bootstrap Responsive Navbar Broken on Small Screens

空扰寡人 提交于 2019-12-09 08:17:02
问题 I've been reading the docs and comparing my code to Bootstrap's examples, but I cannot figure out why the navbar on my site drops down about 100px when I make my browser window smaller or view it on a phone. http://warm-ocean-8133.herokuapp.com/ Here's my html in jade template format. .navbar.navbar-fixed-top .navbar-inner .container a.btn.btn-navbar(data-toggle="collapse",data-target=".nav-collapse") span.icon-bar span.icon-bar span.icon-bar a.brand(href='#home') Miles Matthias .nav-collapse

Using Bootstrap 3 how can I hide columns in my table?

半城伤御伤魂 提交于 2019-12-09 07:36:24
问题 I'm trying to hide columns for my responsive design when in col-xs and col-sm . I first attempted to use hidden-xs/hidden-sm classes, but this didn't work. I also tried using visible-desktop as mentioned here: Twitter Bootstrap Responsive - Show Table Column only on Desktop That also didn't work. What is the best way to do this? I rather not make two separate tables and then hide one or the other. Code I tried that's not currently working: <table> <thead> <th>Show All the time</th> <th class=

css media queries: target mobile devices without specifying width, pixel ratio, etc

可紊 提交于 2019-12-09 06:33:22
问题 Let's say I just want to target every tablet and phone, regardless of size, is there a media query for this? Is it possible to do this without specifying a size? Or is using a size the only way to target mobile devices, and not desktops? 回答1: In the CSS3 spec, @media handeld is mentioned but it has perhaps no browser support. So, no. However, you might find this site useful, it explains other some media query techniques for mobile. 回答2: I've been struggling with this for a few days, but a

Bootstrap 3 Hide Dropdown Menu on Menu Item Click

天涯浪子 提交于 2019-12-09 04:22:20
问题 Check out the fiddle. I have a basic Bootstrap 3 responsive nav like so: <div id="navbar" class="navbar navbar-fixed-top navbar-inverse"> <div class="container"> <a id="navbar-toggle" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </a> <a class="navbar-brand" href="#">Title Title Title</a> <div id="nav-collapse" class="nav-collapse collapse"> <ul class="nav navbar-nav"> <li>