Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Applying background image and css to the child elements of list

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #41548
    prathoven
    Participant

    Hello everyone,
    I’m trying to achieve this

    by css code
    #nav ul li ul li:first-child
    {
    background-image: url(‘../images/menuArrow.png’);
    background-repeat:no-repeat
    background-color: rgb(238,237,237);
    }
    #nav ul li ul li /*applying background color to other child element */
    {
    background-color: rgb(238,237,237)
    }
    But this overwrites the css property for background images.

    Is there anyway to achieve this. Thanx for zillion on taking interest in this problem

    #118695
    David_Leitch
    Participant

    I’ve worked up [something](http://codepen.io/David_Leitch/pen/ygHthhttp://codepen.io/David_Leitch/pen/ygHth”) that you could use, which uses only pseudo elements to create the triangle indicator. I’ve used the pseudo-element of the parent menu anchor to create the triangle, but it would be easy enough to use the first child’s pseudo element to create it as well

    #118702
    prathoven
    Participant

    @David: Thanx david you rocked my day! Your code is clean, I feel like hanging in the wall! Thanx for your help.

    @joshuan: I think its kind of solved now.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.