Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #335604

    Hello,

    I followed the example here (https://kriesi.at/support/topic/adding-a-logoimage-to-the-right-of-the-header/) and i managed to add my image correctly.

    I want to know if it possible when i shrink the browser for that image to change when reaching responsive sizes; ie my image has some text in it, which could be replaced with an image with no text.

    Thanks in advance.

    #335894

    Hi george!

    Thank you for using Enfold.

    Apply the custom image as background on the custom div:

    echo "<div class='header-custom-image'></div>";
    

    Add this on Quick CSS or custom.css:

    .header-custom-image {
    display: block;
    width: 100px;
    height: 50px;
    background: url(IMAGE URI HERE);
    }

    After that, use css media queries to change the background image on smaller screen sizes.

    Best regards,
    Ismael

    #335974

    thanks for the response.

    you mean something like this?

    @media screen and (max-width: 487px) {
    display: block;
    width: 100px;
    height: 50px;
    background: url(SECOND IMAGE URI HERE);
    }

    @media screen and (max-width: 700px) {
    display: block;
    width: 100px;
    height: 50px;
    background: url(SECOND IMAGE URI HERE);
    }

    #337881

    Hey!

    Yes, the actual code should be like this:

    
    /* Mobile */
    @media screen and (max-width: 487px) {
    	.header-custom-image {
    		display: block;
    		width: 100px;
    		height: 50px;
    		background: url(SECOND IMAGE URI HERE);
    	}
    }
    /* Tablets */
    @media screen and (max-width: 767px) {
    	.header-custom-image {
    		display: block;
    		width: 100px;
    		height: 50px;
    		background: url(SECOND IMAGE URI HERE);	
    	}
    }

    Cheers!
    Josue

    #338151

    thank for all the help

    #338204

    You are welcome, glad we could help :)

    Regards,
    Josue

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Replacing image when responsive.’ is closed to new replies.