responsive

responsive website using descendant selectors

随声附和 提交于 2019-12-02 10:21:12
im trying to make my website responsive using media queries, however the page is not responding when i used the descendant selector in certain parts of me code. The page is responsive when i use this code: .div1{ float: left; width:20%; height: 200px; background-color:red; border: 1px solid #f2f2f2; margin-left: 2%; border-radius: 50%; } .div2{ float: left; width:20%; height: 200px; background-color:yellow; border: 1px solid #f2f2f2; margin-left: 2%; border-radius: 50%; } .div3{ float: left; width:20%; border-radius: 50%; height: 200px; background-color:blue; border: 1px solid #f2f2f2; margin

Automatically splitting text content into even columns

久未见 提交于 2019-12-02 00:15:05
问题 Can't find any documentation to see if anyone's already done this. I imagine it's possible through javascript or PHP. I'll explain what I'm trying to accomplish as so: Assume I'm using Twitter Bootstrap 4. Say I have the following content in HTML: <div class="row"> <div class="col-12"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce bibendum posuere porta. Sed vitae dictum odio. Quisque nec rhoncus justo. Sed tempus pharetra convallis. Nunc rhoncus nibh nisi, eget lobortis

Automatically splitting text content into even columns

蓝咒 提交于 2019-12-01 21:17:16
Can't find any documentation to see if anyone's already done this. I imagine it's possible through javascript or PHP. I'll explain what I'm trying to accomplish as so: Assume I'm using Twitter Bootstrap 4 . Say I have the following content in HTML: <div class="row"> <div class="col-12"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce bibendum posuere porta. Sed vitae dictum odio. Quisque nec rhoncus justo. Sed tempus pharetra convallis. Nunc rhoncus nibh nisi, eget lobortis nisl efficitur eget. Fusce nec tincidunt felis, id tempor arcu. Interdum et malesuada fames ac ante

HTML CSS Responsive paragraph tag

泪湿孤枕 提交于 2019-12-01 13:57:23
I am designing a webpage and I am almost finished but there is a small issue that I can't seem to figure out. HTML: <html> <head> <style> * {margin:0; padding:0; text-indent:0; } .float-box-footer{display:inline-block;position:relative;height:37px;background-color:#accb32;max-width: 860px;width: auto\9;} .p4{font-size: 12pt; color: black; padding-left:5pt; left:0; top:7pt; font-family:National, Arial, sans-serif;position:relative;} .p5{font-size: 7pt; color: black; padding-left:465pt;} </style> </head> <body> <div class='float-box-footer'> <p class="p4">Learn more <a href="http://www.google

Why are some of the grid lines randomly disappearing on my responsive D3 chart?

戏子无情 提交于 2019-12-01 07:40:09
I have created a stripped down JSFiddle of my D3 chart. I have made it responsive (with viewbox and preserveaspectratio) using the solution at: responsive D3 chart When I resize the window and make it smaller, some of the grid lines seem to be disappearing and reappearing. I presume this will look bad at small resolutions (eg. 320x480 mobile phone). Is there a way to preserve my gridlines when the window gets resized smaller? HTML code: <!--//d3 chart//--> <div class="centre-div"></div> CSS Code: .centre-div { margin: 0 auto; max-width: 550px; } /* D3 chart css */ .axis path, .axis line { fill

Flexbox: Alternate “row” and “row-reverse” according to row's number

六眼飞鱼酱① 提交于 2019-12-01 06:06:21
问题 I am trying to create a responsive layout with Flexbox which allows me to alternate both the directions row and row-reverse . Maybe you can understand it better with some image (mind the order of the boxes): And resizing: Or still: You can imagine an arrow that goes through each box, it must be possible to go through 1 to 8 following the sequence of numbers (like a snake). How can I achieve it using flexbox? I think I can use the order CSS property, but I miss a dynamic way to set it. I don't

Keep image ratio using max-width and max-height in IE 11

房东的猫 提交于 2019-11-30 17:49:14
I'm trying to get an image to fit inside a container while keeping it's size ratio. The image should take full height or width depending on orientation. My solution does work on all browsers I've tested but IE11(works in 10 and 9 surprisingly). In IE 11 the image is cropped on the right. I'd like a pure css way if possible and I don't care about centering it. Here is the JSFiddle : https://jsfiddle.net/wagad0u8/ <div class="owl-item" style="width: 465px;"> <a class="img-flux" href="page1.html"> <img alt="omg" src="http://placehold.it/1000x100"> </a> </div> <div class="owl-item" style="width:

How to change the flex order when wrapping [closed]

橙三吉。 提交于 2019-11-30 11:59:37
I would like to achieve something that renders like this depending on the screen size: +---------------------------+ | A | B | C | +---------------------------+ +---------------+ | A | C | | B | +---------------+ if all size are fixed, i can manage using the flex order property but the size of my C container is not fixed and so I can't use a static media query. Is there a way to achieve this? Edit: I managed a good enough approximation: In a media query selecting all screens that might need wrapping, I change the order of the B container to something big, and at the same time, I set its min

How can I respond to the width of an auto-sized DOM element in React?

荒凉一梦 提交于 2019-11-30 10:08:35
问题 I have a complex web page using React components, and am trying to convert the page from a static layout to a more responsive, resizable layout. However, I keep running into limitations with React, and am wondering if there's a standard pattern for handling these issues. In my specific case, I have a component that renders as a div with display:table-cell and width:auto. Unfortunately, I cannot query the width of my component, because you can't compute the size of an element unless it's

How can I respond to the width of an auto-sized DOM element in React?

好久不见. 提交于 2019-11-29 18:50:24
I have a complex web page using React components, and am trying to convert the page from a static layout to a more responsive, resizable layout. However, I keep running into limitations with React, and am wondering if there's a standard pattern for handling these issues. In my specific case, I have a component that renders as a div with display:table-cell and width:auto. Unfortunately, I cannot query the width of my component, because you can't compute the size of an element unless it's actually placed in the DOM (which has the full context with which to deduce the actual rendered width).