I googled everything by now and tried everything including img-fluid, did not work, I can't seem to figure out how to make the image responsive (pretty much a beginner lol), if I resize the browser window the image stays the same size, does not scale.
The logo image size that am trying to keep is 734px x 132px
Edit: I have already tried auto height and still doesn't work
.navbar-brand {
color: $primary;
padding: 0;
img {
max-width: 100%;
height: 132px;
max-height: 132px;
#include media-breakpoint-down(md) {
max-height: 132x;
}
}
}
#include media-breakpoint-up(md) {
.header-navbar-top-right-search {
margin-left: auto;
}
}
#include media-breakpoint-up(lg) {
.header-navbar-top-left {
max-width: 42%;
flex: 0 0 42%;
}
.header-navbar-top-center {
max-width: 16%;
flex: 0 0 16%;
}
.header-navbar-top-right-search {
flex: 0 0 auto;
}
.header-navbar-top-right {
flex: 0 0 auto;
}
}
.header-top-line {
background-color: $section-bg;
a:not(.edit-link) {
padding: 22px $spacer 20px;
font-size: 0.8125rem;
line-height: 1.125rem;
}
.login-list > .nav-item a {
font-weight: 700;
}
}
.header-bottom-line {
background-color: $white;
}
.header-quantity-box {
margin-left: $spacer * 0.25;
}
.nav-link,
.search-module .btn,
.header-navbar a {
color: $white;
&:active,
&:hover {
color: $primary;
}
}
Give it some width and put the height as auto.
img{
width: 100%;
height: auto;
}
Update 1
Now see, You can update max-width as your need
Snippet
.navbar-brand {
color: blue;
padding: 0;
}
.navbar-brand img {
max-width: 734px;
height: auto;
width:30%;
margin: auto;
}
#media only screen and(max-width: 768px){
.navbar-brand img{
width: 40%;
}
}
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<a class="navbar-brand" href="#">
<img src="https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_160x56dp.png" title="borhykerteszetcsomagküldés" alt="borhykerteszetcsomagküldés"></a>
Did this help you 🤨?
Related
I have a link on my menu items and id's on h2 of the text that belong to it. All I want to do is easy - when I click on certain item in the menu I want it to move down to the text that belongs to it. Easy.
I have it like side menu on the left and next to it is the text. When the resolution is under 479px the "side menu" is at the top and the text is under it. And what I want it to do is only when it is under this resolution - to jump down to the text (h2). When is it side by side it is fine and there is no need to do that of course. So my question is.. is it posiible to do so somehow only by using html and css? To make it work ("jump") only when it is under 479px? Media queries somehow?
Thanks you
<section id="budova">
<div class="materials">
<div class="container">
<h1>BUDOVA (izolace)</h1>
<div class="materials-container">
<div class="kategorie">
<h2 data-kategorie="#silsonic" class="active">Silsonic</h2>
<h2 data-kategorie="#mappysil400">Mappysil CR 400</h2>
<h2 data-kategorie="#mappysil404">Mappysil CR 404</h2>
<h2 data-kategorie="#polistik">Polistik / M under special HQ</h2>
<h2 data-kategorie="#pavisol">Pavisol</h2>
<h2 data-kategorie="#mappysilent">Mappysilent</h2>
<h2 data-kategorie="#fonosilent">Fonosilent</h2>
<h2 data-kategorie="#bugnato">Mappysil CR Bugnato</h2>
<h2 data-kategorie="#mappysil-re">Mappysil CR RE</h2>
<h2 data-kategorie="#mappypren">Mappypren AU</h2>
<h2 data-kategorie="#stopfire">Stopfire Bugnato</h2>
</div>
<div class="produkty" id="produkty">
<div id="silsonic" class="active">
<h3>Silsonic</h3>
<img src="./img/materials/budova/silsonic.jpg" alt="Silsonic">
<p>Cena od 150 kč vč. DPH</p>
<p>v 40/š 600/d 1200 mm ( ostatní rozměry v sekci ceník )</p>
<p>SILSONIC je termoizolační a akusticky absorpční materiál vyrobený z tepelně zpracovaných, recyklovaných polyesterových vláken. Panely SILSONIC se používají k tepelné a zvukové izolaci všech druhů zdiva, sádrokartonových konstrukcí, stropů a pro podstřešní izolace.</p>
</div>
.
.
.
more text
CSS
.materials-container {
display: grid;
grid-template-columns: 1fr 3fr;
margin: 3rem 0;
}
.materials h1 {
text-align: center;
padding: 6rem 0 1.5rem;
font-family: "Montserrat", sans-serif;
font-weight: 300;
letter-spacing: 1px;
border-bottom: 1px solid;
width: 90%;
margin: auto;
}
.kategorie {
background-color: #c4c4c4;
text-align: center;
padding: 1rem 0;
border-radius: 10px;
margin-bottom: 8rem;
}
.produkty {
display: flex;
justify-content: center;
/* align-items: center; */
margin-left: 10rem;
}
.produkty div {
display: none;
}
.produkty div.active {
display: initial;
}
.produkty h4 {
text-transform: uppercase;
margin-top: 3rem;
}
.produkty p:first-of-type,
.produkty p:nth-of-type(2) {
font-weight: 600;
}
.produkty img {
max-width: 300px;
}
.materials {
padding-bottom: 40px;
}
.materials p {
line-height: 24px;
}
.materials h1 {
margin-bottom: 5rem;
}
.materials h2 {
width: 70%;
cursor: pointer;
font-size: 1.2rem;
font-weight: 300;
padding: 0.8rem 0;
border-bottom: 1px solid transparent;
margin: 0 auto;
transition: all 0.3s;
}
.materials h2:hover {
border-bottom: 1px solid #fff;
color: #fff;
}
#media (max-width: 479px) {
.main-text p {
line-height: 2rem;
}
.main-text h1 {
padding: 4rem 0 0.5rem;
}
.photos img {
width: 60%;
margin: auto;
}
.photos {
height: 160px;
}
.nav-menu .logo {
width: 53%;
height: 52px;
}
.materials-container {
display: block;
}
.materials h2 {
font-size: 1.2rem;
}
.kategorie {
margin-bottom: 5rem;
}
#fonosilent {
width: 100%;
}
}
make an extra "link" in the html
on small screens one will be hidden (the one without jump-to-link) while the other one (with anchor-tag and jump-to) will be shown.
...
<div class="kategorie">
<h2 data-kategorie="#silsonic" class="active">Silsonic</h2>
<h2 data-kategorie="#silconic" class="active big-screen">Silsonic</h2>
...
media-queries in css:
#media (max-width: 479px) {
.big-screen {
display: none;
}
.small-screen {
display: grid/flex/whatever;
}
}
#media (min-width: 480px) {
.big-screen {
display: grid/flex/whatever;
}
.small-screen {
display: none;
}
}
I have been trying to figure this out, and just don't see what is wrong. So frustrating, but wanted to see if anyone can see why when resizing the browser window, the site is not responsive. However, inside of Chrome's and Firefox's inspector tools, I am able to see the website being responsive with different device sizes. I have been using #media screen (max-width) NOT device-width, which I know can cause this issue. I appreciate the help!
/***MEDIA QUERIES*****/
#media screen (max-width: 880px) {
#location-icon {
margin: 5px 10px 90px 0;
}
}
#media screen (max-width: 760px) {
.first-footer {
flex-direction: column;
}
#location-icon {
margin: 5px 10px 40px 0;
}
.copyright {
margin: 0;
}
.first-footer {
padding-bottom: 0;
}
}
#media screen (max-width: 375px) {
.intro {
flex-direction: column;
}
.intro img {
width: 100%;
}
.intro div {
padding-right: 0;
padding-bottom: 20px;
text-align: center;
}
.intro button {
margin: 40px 0;
}
.logo-button button {
padding: 20px;
width: 200px;
}
.logo-button img {
width: 100px;
}
.box {
flex-direction: column;
padding: 30px 40px;
text-align: center;
}
.mid-text {
order: 2;
padding: 0;
}
#location-icon {
margin: 5px 10px 100px 0;
}
.list1 {
margin: 30px 0 0 0;
}
.list2 {
margin: 0;
}
.icons {
align-self: center;
text-align: center;
margin-top: 30px;
}
.copyright {
margin: 0;
}
.first-footer {
padding-bottom: 0;
}
}
First off, you need to add "and" when you write a media query with two conditions like this :
#media screen and (max-width: 880px)
However the reason it isn't working is due to your container class in the body tag. If you remove it, it will fix most of your issues since there is no reason to use grid in that context
I'm making a site using the Divi theme (elegant themes) in Wordpress. I've been trying to get rid of the white space under the footer but have been unsuccessful. I've tried applying the Sticky Footer CSS and trying different padding/margins in the footer id, html and body. The site is thedaltondaleygroup.org.
I've created a page with divi builder and then copied the shortcode from revisions into footer area #1.
Here's the css code I've tried, this is attempting to apply the sticky footer css:
html, body {
height:100%;
}
#main-content {
min-height: 100%;
/* equal to footer height */
margin-bottom: -142px;
}
#main-content:after {
content: "";
display: block;
}
#main-footer, #main-content:after {
height: 142px;
}
.et_pb_gutters3 .footer-widget {
margin: 0 .5% 3% 0; */
}
Here's the rest of the code I have for the footer if there's anything conflicting:
#main-footer {
box-shadow: inset 0px 0px 20px 10px rgba(0,0,0,0.3);
padding-bottom:1%;
}
.et_pb_row .et_pb_row_3 .et_pb_gutters2 .et_pb_row_fullwidth et_pb_row_1-2_1-4_1-4 {
width:100%;
max-width:100%;
}
#footer-bottom .container, #main-footer .container{
margin-right: 2.773%;
margin-left: 2.773%;
width:94.454%!important;
max-width: 94.454%;
}
#main-footer .fwidget.et_pb_widget {
width: 100%!important;
max-width: 100%!important;
}
#footer-widgets .footer-widget li:before {
display: none;
}
html #footer-widgets .footer-widget .et_pb_widget:not(.woocommerce) ul li {
line-height: 26px;
padding-left: 0px;
}
#footer-widgets {
text-align: center;
color: #ffffff;
padding-top: 2%;
width: 100%;
height: auto;
}
:not(.et_pb_fullwidth_section).et_pb_section {
padding-top: 0px !important;
padding-bottom: 0px !important;
}
#footer-bottom {
padding: 0;
}
#main-footer {
width: 100%;
height:auto;
}
/* Footer Columns - Centered */
.footer-widget { margin-right: 0; text-align:center;}
.footer-widget:nth-child(1) { width: 32%; padding-right:15px;}
.footer-widget:nth-child(2) { width: 32%; padding-right:15px;}
.footer-widget:nth-child(3) { width: 32%; margin-right:0;}
.footer-widget+.last{display:none;}
#media only screen and (max-width: 980px){
.footer-widget:nth-child(1) { width: 30%; padding-right:15px;}
.footer-widget:nth-child(2) { width: 30%; padding-right:15px;}
.footer-widget:nth-child(3) { width: 30%; margin-right:0;}}
#media only screen and ( max-width: 767px ) {
.footer-widget:nth-child(1) { width: 100%; padding-right:15px;}
.footer-widget:nth-child(2) { width: 100%; padding-right:15px;}
.footer-widget:nth-child(3) { width: 100%; margin-right:0;}}
Before I write any css code I usually type out html,body,p,h1,h2 { margin:0; padding:0;} etcc...This usually fixes it for me,
Or you can google a css reset page and they have most of that pre-written...
hope this helps.
If you have a menu in the bottom/footer with dropdown menus, make sure in the design>Layout to set "Dropdown Menu" to "Upwards". If not it will cause white space.
Wow I am really struggling.
I have created responsive themes for many many sites but can't get it to work on my own!
The dev version of the site is at Development Site and the CSS for the phone part of the stylesheet is below:
#media only screen and (max-width: 767px) {
* {
float: none!important;
width: 100%!important;
}
#container, #home-boxes, #header, #home-scroller, #main-nav, #main-footer, #content, #sidebar {
width: 100%!important;
overflow:hidden;
float: none;
}
.wrapper {
width: auto;
margin: 0;
}
#header {
width: auto;
}
#home-scroller h1 {
font-size: 50px;
}
#home-scroller h1 span {
font-size: 30px;
}
#home-scroller p.home-price {
font-size: 30px;
}
#home-scroller a.button, #home-scroller a.buttonalt {
display: block;
}
#home-scroller p.bottom {
position: inherit;
}
ol.dots { display: none; }
#home-scroller li {
width: 100%;
}
#main-nav {
float:none;
}
#home-boxes-inner .home-box, .footer-box {
float: none;
width: 100%;
margin-right: 0;
}
img {
width: 100%;
height: auto;
}
#logo {
float: none;
}
}
As you can see if you visit the site on a mobile it's not even close to being anywhere near correct.
Does anyone have any pointers on where I should be looking?
Much appreciated!
The hard coded html-width conflicts with this nice meta setting :
html {
min-width: 1060px; /* hard coded width for large screens */
}
#media only screen and (max-width: 767px) {
/* new: fit viewport to small device screen */
min-width: 100%
}
Try changing your meta width tag from
<meta wisth...
To
<meta width...
In this below CSS structure, the RIGHTCOLUMN, CONTENT, LEFTCOLUMN needs to open in the same order one by one. That is the properties of #rightcolumn #content #leftcolumn should be visible in the same order of screen as 1,2,3 (for low width resolution devices below 600px)
As Below:
header
title -
description -
rightcolumn -
content -
leftcolumn -
footer
One gentle man Mr.Pschueller helped me with Media queries. It was useful. But its just for 2 columns, that it #content and #leftcolumn.
When i try the same for 3 columns my brain Hangs. So i may need some one help. The code is given below. I don't know where I am wrong.
The present screen status of this code is:
header -
title -
description -
content -
rightcolumn -
leftcolumn -
footer
So the RIGHTCOLUMN should open BEFORE CONTENT without overlapping. This is my issue now.
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 13px;
color:#333
}
p {
padding: 10px;
}
#wrapper {
width: 100%;
min-width: auto;
max-width: auto;
margin: 0 auto;
}
#header {
float: left;
height: 80px;
width: 100%;
background: #3b5998;
}
#title {
float: left;
height: 40px;
width: 100%;
background: #ffffff;
}
#description {
float: left;
height: 40px;
width: 100%;
background: #f2f2f2;
}
#leftcolumn {
background: #FFFFFF;
width: 200px;
float: left;
margin-left: -100%;
}
#rightcolumn {
background: #FFFFFF;
width: 340px;
float: left;
margin-left: -340px;
}
#content {
background: #FFFFFF;
margin-left: 201px;
margin-right: 340px;
}
#contentliquid {
float: left;
width: 100%;
}
#footer {
height: 30px;
width: 100%;
background: #3B5998;
clear: both;
}
#media screen and (max-width: 600px) {
#content {
margin-left: 0;
margin-right: 0;
float: none;
}
#rightcolumn {
margin-left: 0;
margin-right: 0;
float: none;
}
#leftcolumn
{
margin-left: 0;
margin-right: 0;
float: none;
}
}
I solved the issue myself:
The last code of the Media queries is edited as follows and it is able to work even in 240x320 Screen resolution. As i expected now I am able to open the site in blackberry phone in the order 1,2,3 which results header title - description - content - rightcolumn - leftcolumn - footer
Below is the editing I made at the end: Note: If you add flot in the last LEFTCOLUMN then the screen will start to overlap.
I am not a Designer or a Programmer. But i am doing this for time pass by learning simple things. So those who are professionals don't joke with my addings.
On the browsing way i came to this stackoverflow and finally my problem is solved.
Thanking you.
#media screen and (max-width: 600px)
{
#content {
margin-right: 0;
margin-left: 0;
float: none;
}
#rightcolumn {
margin-left: 0;
float: none;
}
#leftcolumn
{
margin-left: 0;
}
}