Coder Social home page Coder Social logo

Comments (6)

IagoLast avatar IagoLast commented on July 28, 2024

Something like this?
hamburger

Remember to change the #toggle background in css:

background: #ddd url("/static/images/hamburger.png") no-repeat 50% 33%;

from responsive-nav.js.

andalusi avatar andalusi commented on July 28, 2024

Hi lagoLast,

thank you for answer me!

Maybe my question is not specific enough.
But I would like to know how to change the color of a transparent gif only with CSS?

In your example above the background color change, but the hamburger icon itself remain its grey color .

from responsive-nav.js.

fspoettel avatar fspoettel commented on July 28, 2024

Manipulating images is not possible with CSS alone - at least not with any kind of acceptable browser-support ( See -webkit-filters but it is a non-standard, experimental approach so no valid option). What you could do with CSS however is to utilise pseudo-element-techniques or icon-fonts to generate a hamburger. Chris Coyier has a great roundup on different techniques: http://css-tricks.com/three-line-menu-navicon/ They require some CSS-knowledge and maybe some tweaking, but you will be able to change the color directly in CSS.

from responsive-nav.js.

andalusi avatar andalusi commented on July 28, 2024

Hey guys,

please see into the advanced demo folder on this project!
There is an transparent hamburger.gif icon.
In the css file (same folder) you can give this f***ing gif any color you want.
Try it yourself!

My question is, how to make this kind of transparent gif!

Hope its clear now.

Best, andalusi.

from responsive-nav.js.

fspoettel avatar fspoettel commented on July 28, 2024

The gif in the advanced folder is made the other way round - instead of having a colored "hamburger" the space around the "hamburger" is colored in the gif - with the page background, which is #fff, leaving the hamburger transparent. So if you want to do it this way, you can edit the "hamburger" by setting multiple background in CSS with the first being a color as in the demo css. But you have to know the page-background, so it is not more dynamic. Fired up Pixelmator, maybe an image is clearer. The red is any background and the selected element is the actual gif: http://puu.sh/3ts18.png

from responsive-nav.js.

andalusi avatar andalusi commented on July 28, 2024

Ok, now it makes sense.
Wouldn't it be awesome making just a transparent .gif or .png and apply both color and background-color only with CSS? It would safe a lot of time because changing the color using Pixelmator or Photoshop its sometimes to complicated.

Anyway, thanks for your kind explanation.

from responsive-nav.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.