responsive-design

How to horizontal scroll square boxes in a mobile view in html/css?

那年仲夏 提交于 2019-12-11 15:48:15
问题 I have a website which looks perfect on the desktop view. I have created the fiddle as well so that its easy to make changes. The snippets of CSS codes which I have used in order to align the squares in a row are: .squares { display: flex; justify-content: space-between; align-items:center; padding: 1rem; flex-wrap: wrap; } .squares .square { width: 13%; text-align: center; height: 150px; padding-top: 1%; padding-left: 1%; padding-right: 1%; border-style: solid; border-width: 3px; border

Does iOS/mobile Safari provide a javascript event or a media query for its font resizing control?

拟墨画扇 提交于 2019-12-11 15:26:51
问题 A responsive website that I style uses js to determine font sizes then applies classes that are used by css for various layout adjustments. In a nutshell, my js detects the resize of a span wrapped around a text character. The newest version of mobile Safari provides a font resize control and its zoom mechanism isn't triggering my detection js. Any ideas about events or other changes that I can use to detect mobile Safari's font resizing? Maybe a css media query? I tried a solution based on

Replace part of filename with javascript

本小妞迷上赌 提交于 2019-12-11 15:25:21
问题 I want to load different images based on screensize, and thought replacing text in a filename with javascript would do the trick elegantly, as long as I've got corresponding images properly named. I'm close with this, but close won't cut it. http://jsfiddle.net/B7QhZ/2/ Javascript: if ($(window).width() > 960) { $("div:contains(_small.jpg)").html(function (i, currentVal) { return currentVal.replace("_small.jpg", "_large.jpg"); }); } HTML: <img src="...test-image_small.jpg" /> As you can see

Responsive HTML Tiles - Fill Browser Window

不羁的心 提交于 2019-12-11 15:08:13
问题 My recently created JSFiddle contains a basic layout with containers that display content on both sides (once clicked on, they flip over). When I resize the browser window, I would like everything to be larger or smaller (essentially responsive) without compromising the spaces in between or the general layout of the page. Question: How would I scale my content to the hight of browser window while maintaining the aspect-ratio of the tiles? After hours of searching, I am still no closer to

Why Are There Horizontal Scrollbars on My Responsive Webpage

情到浓时终转凉″ 提交于 2019-12-11 15:07:01
问题 My website behaves responsively, so why are there horizontal scroll-bars ? I am confused by this! What does it take for the horizontal scrollbars to disappear? Also, the header doesn't shrink at the 320px mark on mobile devices, even though it does it when tested in the code editor....??? Here is the link to my CodePen: https://codepen.io/IDCoder/pen/Xevyqq Here is my HTML code: <html> <title></title> <head><meta name="viewport" content="width=device-width, initial-scale=1"></head> <body>

Responsive Layout with left floating additional div

和自甴很熟 提交于 2019-12-11 15:01:50
问题 I have to build a responsive layout with the following simple markup: <div class="wrapper"> <div class="div1"></div> <div class="div2"></div> <div class="div3"></div> </div> div2 and div3 should be centered and div1 should be a left floating additional div (for biographical data or something). The expected: ______ __________ | || | | div1 || div2 | |______|| | |__________| | | centered-> | div3 | <-centered | | |__________| My status with false floating: ______ __________ | | | | | div1 | |

How to fix the footer in 4k resolution?

柔情痞子 提交于 2019-12-11 14:57:19
问题 When i put in 4k resolution, the footer rises and a blank space appears below it. I've tried to put the html height 100%, but it doesn't work it. ]1 回答1: You could calculate the height of the main content such that footer is always at the bottom. Something like: .header{ height: 50px; } .main { height: calc(100vh - 100px); } footer { height: 50px; } JSFiddle 回答2: Try to add following CSS to your footer class .footer{ position: fixed; bottom: 0; } 回答3: There are a number of different solutions

Sticky nav bar with jQuery jerky on window resize

末鹿安然 提交于 2019-12-11 14:56:46
问题 I'm working on a sticky nav-bar for the first time and I got everything working nicely until trying to make it responsive. When the window is resized, the jQuery for the nav bar causes the page to freeze for a bit feeling kind of jerky. Am I overdoing it with the resize checks? jQuery(document).ready(function() { //on page load will get nav offset and wrap nav in a placeholder //for smooth transition to fixed position var navOffset = jQuery('.nav').offset().top; jQuery('.nav').wrap('<div

CSS layout (2 column layout, but if no sidebar main column must be 100% wide)

时光怂恿深爱的人放手 提交于 2019-12-11 14:56:06
问题 Column1 (left) is for content. Column2 (right/ sidebar) is for related info. say layout is 66%/34%. I need a way to make Column1 to stretch to 100% automatically if there is no sidebar content. Any idea's. I know it can be done. I just can't remember how. +---------+---------+ | Content | sidebar | +---------+---------+ +-------------------+ |Content/ no-sidebar| +-------------------+ 回答1: You might try something like this. Here are the two different HTML cases: With sidebar: <div id=

Responsive layout out of line in FF and IE

一个人想着一个人 提交于 2019-12-11 14:33:33
问题 If you were to look at the following website in Chrome, you would see the printers in 2 rows. Which is how it is supposed to be. But in FireFox and Internet Explorer the 4th product is aligned on the right by itself. I have tried everything I can think of, and scoured the web. I would really welcome any help anybody can give me regarding this issue. http://www.thewideformatgroup.co.uk/Products/general-office-use 回答1: Change float: left to display: inline-block on the items ( .shop-main li ,