answerstu

html - How to use thumbnail image different than detail image

I have an image heavy gallery page where I'm wanting to use a thumbnail image that is pre-sized to be a maximum width of 200px. The actual size of each image is very large, often exceeding 2000 pixels on the longest side.I've been using the Bootstrap class img-responsive img-thumbnail in order to set the thumbnails, but it seems to be using CSS to generate the thumbnails and it's still having to download the entire set of images. This is causing the page to load very slowly.I've tried generating actual thumbnail images, but when we click on the...Read more

html - Show/Hide contents by clicking an icon using CSS (no javascript)

Is it possible to use something similar to toggle on/off or show/hide but rather than using panels or accordion menu, use icon-blocks instead?There are 4 icons arranged in a row, clicking each icon should display the contents below the icon row, but only one content should be displayed at any given time. I'm looking for CSS/HTML solution only - no javascript. Icons are arranged in a row, using grid<!--display icons in a row, 4 columns--><div class="quarter"> <span class="icon1"></span></div>Below the 4th 'qu...Read more

html - Hide and show buttons need to be "show" first

I want to make some show/hide button, but I need the element to be invisible first and only visible after pushing the button - just the opposite from how it is now:function myFunction(x) { x.classList.toggle("change"); var x = document.getElementById("navigationList"); if (x.style.display === "none") { x.style.display = "block"; } else { x.style.display = "none"; }}<div class="navigation_bar"> <button class="hamburger" onclick="myFunction(this)"> <div class="bar1"></div> <div class="bar2">...Read more

html - Is it possible to shrinkwrap flex items with wrapping text inside them?

I have an unassuming nav menu:<div> <ul> <li><a href="/real-estate"><span>Real Estate &amp;&nbsp;Development</span></a></li> <li><a href="/new-business"><span>New &amp; Expanding Business</span></a></li> { … } </ul></div>This menu needs the following visual properties:Items distributed horizontally within their container by putting equal space between themText in items can wrap to make items take up less horizon...Read more

html - Image height in svg is higher than SVG

I'm developing my portfolio, and I want to insert some websites screen capture in mockups. I don't want to take care, each time I want to add a project, to integrate the screenshot of the project'site in a mockup on Photoshop, to generate a JPG image that I would include in my site. So I thought of a relatively simple solution, which would be to take a mockup in SVG, and integrate the image directly into it.Here's the problem, the image is higher than the mockup, and I would like the height of my SVG to be automatic compared to the size of the ...Read more

html - Keep svg pattern scaling when resizing svg-shape

I have a svg-pattern applied to a polygon. It's working fine. When I set another size on the svg-polygon, I don't want to scale the pattern. I've tried all combinations I can think of with viewBox, patternUnits and patternContentUnits. The goal is to make the polygon work responsibly e.g. scale with it's parent element. Can anyone point me in the right direction? <svg width="1000" fill="#ccc" viewBox="0 0 1440 60"> <defs> <pattern id="pattern" x="0" y="0" width="900" height="600" patternUnits="userSpaceOnUse" patternContentUn...Read more

html - Unwanted top padding inside div element

I have such HTML:<div class="select-wrapper"> <select name="type"> <option value="test">test</option> </select></div>And css:#search-box .select-wrapper { display: inline-block; padding: 6px; background: #eaeced;}#search-box select { font-size: 11px; margin: 0px; padding: 0px; padding-left: 8px; border: 1px solid #a6a6a6; -webkit-border-radius:2px; -moz-border-radius:2px; -border-radius:2px;}However somehow wrappers top padding is bigger then bottom one:When I hig...Read more

html - CSS grid min-content not shrinking to correct size

I'm new to grids and I'm trying to understand some cell sizing concepts.I have a container that is set to display: grid and a main element centered in the grid where the min-content column/row is..main-container { display: grid; grid-template-columns: 1fr min-content 1fr; grid-template-rows: 1fr min-content 1fr;}.main-container main { grid-column: span 1 grid-column-start: 2 grid-row: span 1 grid-row-start: 2}canvas { width: 800px; height: 600px;}and html<!-- page --><html>...<body> <div class="main-container">...Read more

html - Span within div with grid cell alignment

I have a <span> within a <div> within a grid, for example: .container { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 50px; border-top: 1px solid rgba(0, 0, 0, 0.13);}.label { align-self: center; border-left: 1px solid rgba(0, 0, 0, 0.13); padding-left: 15px; height: 100%;}<div class="container"> <div class="label"> <span>Temperature</span> </div> <button>Add</button></div>...Read more

html - How can i make hover effect on image with caption

so im having little bit of strugle making this work.So basicly what i am trying to make is image with caption under it and when you hover over image it gets greenish color with transparency and a plus sign on it.What ive tried so far is to make <div class=parent> and inside of <div class=parent> i would have <img> and another <div class="overlay"> HTML<section class="gallery"> <div class="container"> <div class="row"> <div class="parent"> <img src="img/showcase.jpg"> &...Read more

html - Align CSS columns side by side

If I have the following HTML in a 2 column layout, how can I align them next to each other using CSS Grid?.grid { display: grid; grid-template-columns: 1fr; grid-row-gap: 1.25em;}aside { grid-column: 1; grid-row: 1; text-align: left;}article { grid-column: 1; grid-row: 2; text-align: left;}<article class="content"> <h2>{{ page.title }}</h2> <p>{{ content }}</p></article><aside class="sidebar"> <h3>{{ page.date | date: '%B %-d, %Y' }}</h3> <p>{{ page.tags | array_to_sentenc...Read more

html - width inherit doesn't fill parent when using calc()

I am trying to make a div expand to the width of the parent. The parent has a calc() on it. Why doesn't the child expand to the width of the parent? If I remove calc and set an actual value it works fine. Is there some trick for getting this to work?I assume that the child is also running calc(100% - 200px)* { box-sizing: border-box;}.wrapper { width: 75%; margin: auto; position: relative;}.nav { width: calc(30% - 16px); height: 2000px; position: relative; background: red;}.nav>ul { width: inherit; background: blue; position: fixe...Read more

html - How to align options one under the other?

This is the problem.I want those Mobile and brand names one under the other.* { padding: 0px; margin: 0px;}.Heading { font-family: tahoma; width: auto; height: 190px; color: white; font-weight: bolder; padding-top: 3%; padding-left: 2%;}.Nav { padding-top: 12px; padding-left: 390px; list-style: none; .}body { background: url("IMG2.jpg")no-repeat; background-size: 100%;}ul li { float: left; padding: 3.5%; width: 15%; background-color: black; opacity: .6; color: white; height: 2%; padding-top: 2%; margin-right: 2px; displ...Read more

html - CSS 3d correctly sort cube drawing order

So I've been messing around with css, but I've run into a sort of a problem. Here is my code:.cube { position: absolute; width: 60px; height: 60px; transform-style: preserve-3d;}.scene { transform-style: preserve-3d;}.side { position: absolute; width: 60px; height: 60px;}.back { background-color: #ee5500; transform: translateZ(-30px);}.right { background-color: #ff8800; transform: translateX(30px) rotateY(90deg);}.top { background-color: #ffaa00; transform: translateY(-30px) rotateX(90deg);}.c1 { position: absolute; transform: r...Read more

html - Column-count Sort Left to Right for a <ul> List

I have the following html and css structure. The problem I am having is that the <li> items are sorted Top to Bottom, instead of Left to Right. I have tried to follow the solutions on other similar posts but it didn't work out for my specific structure. Any ideas please?#mylist { list-style: none; text-align: left; margin: 10px 0 2% 5%; column-count: 3; -webkit-column-count: 3; -moz-column-count: 3; width: 100%;}#mylist li { border-bottom: 1px dashed #eaeaea; padding: 3px 0; margin: 5% 0.5% 0% 0.5%; display: inline-block; min-...Read more