Actual CSS Responsive background not being responsive (?)
Tag : html , By : demize95
Date : March 29 2020, 07:55 AM
Hope this helps It could be an issue with auto fixing CSS in some browsers. I noticed that your max-width property doesn't end with a semi-colon. Some browsers will not show anything after due to running into a syntax error.
|
Five images on the same row with responsive background (responsive row)
Date : March 29 2020, 07:55 AM
help you fix your problem I tried to create a responsive row that contain five inline images on desktop, two columns on the tablet and on column on smartphone. .background {
background-image: url('http://77.238.26.244:81/confimi/wp-content/uploads/2016/08/a.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
height: 100%;
}
.layer {
background-color: rgba(18, 29, 47, 0.96);
background-repeat: repeat;
width: 100%;
height: 100%;
text-align: center;
}
.div-diviso {
width: 17%;
padding: 10px;
display: inline-block;
}
.div-diviso img {
width: 100%;
}
@media (min-width: 768px) and (max-width: 980px) {
.layer {
padding: 0px 0px 900px 0px;
text-align: center;
}
.div-diviso {
width: 47%;
padding: 10px;
}
}
@media (max-width: 767px) {
.layer {
padding: 0px 0px 1500px 0px;
text-align: center;
}
.div-diviso {
width: 98%;
padding: 5px;
}
}
<div class="background">
<div class="layer">
<div class="div-diviso">
<img src="http://77.238.26.244:81/confimi/wp-content/uploads/2017/02/SILVIA-FAIT-2017_980.jpg">
</div>
<div class="div-diviso">
<img src="http://77.238.26.244:81/confimi/wp-content/uploads/2017/02/CLAUDIO-ZAMPARELLI-2017_980.jpg">
</div>
<div class="div-diviso">
<img src="http://77.238.26.244:81/confimi/wp-content/uploads/2017/02/ROBERTA-MAGNANI-2017_980.jpg">
</div>
<div class="div-diviso">
<img src="http://77.238.26.244:81/confimi/wp-content/uploads/2017/02/BARBARA-VANNI-2017_980.jpg">
</div>
<div class="div-diviso">
<img src="http://77.238.26.244:81/confimi/wp-content/uploads/2017/02/SANDRO-CAMPANI-2017_980.jpg">
</div>
</div>
</div>
|
How to configure PurgeCSS for vue-cli-3 projects with TailwindCSS? (including responsive classes)
Date : March 29 2020, 07:55 AM
To fix the issue you can do I'm trying to deploy a vue-cli-3 project. I used TailwindCSS and created a vue.config.js file and it's working, but responsive classes are not being included. I searched about a regex, using a extractor in a webpack.config.js file but it didn't work. What should I do to have this working? , Update your configurations as following: const PurgecssPlugin = require('purgecss-webpack-plugin')
const glob = require('glob-all')
const path = require('path')
module.exports = {
configureWebpack: {
// Merged into the final Webpack config
plugins: [
new PurgecssPlugin({
paths: glob.sync([
path.join(__dirname, './src/index.html'),
path.join(__dirname, './src/**/*.vue'),
path.join(__dirname, './src/**/*.js')
]),
extractors: [
{
extractor: class TailwindExtractor {
static extract(content) {
return content.match(/[A-z0-9-_:\/]+/g) || [];
}
},
extensions: ['html', 'vue', 'js'],
},
],
})
]
}
}
|
TailwindCSS responsive break points not working in Vue
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , Eventually found the solution after a break and finding a Vue project that uses Tailwind. I needed to install postcss-preset-env and add it to postcss.config.js. npm install postcss-preset-env --save-dev module.exports = {
plugins: [
require('postcss-preset-env')({ stage: 0 }),
require('tailwindcss')('tailwind.js'),
require('autoprefixer')
]
}
|
background image with text overlay and background color responsive even to 4k screens
Date : March 29 2020, 07:55 AM
I hope this helps . There are multiple ways to achieve this. I would probably go for a solution like this: Since you want the background color to have the same height as the background image element, the element with the background color needs to get its height from the background image element. That means, the background image element should be inside the element with the background color. The background image element is a 100% wide, but has a max-width. That way to image never becomes to big and shrinks on smaller screens. You need to use the padding-bottom trick to set the height of the background image element. You could avoid that by using an image element, but that's a question of semantics.
|