Forums

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

Home Forums Design Optimize this CSS code

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

    Hello guys,

    I’m not an expert in CSS but I think I can optimize this code in one line, can someone help to find how ?

    #main-header .nav li ul.sub-menu li {
    padding: 0px;
    width: 240px;
    }
    #main-header .nav li ul.sub-menu li a {
    width: 240px;
    }
    #main-header .nav li ul.sub-menu li a:hover {
    width: 240px;
    }

    thanks a lot,

    #260163
    Paulie_D
    Moderator

    Without knowing what it is you are trying to do…not really.

    The 3rd rule is completely redundant as you aren’t changing anything.

    The 2nd may be redundant but it’s targeting a different element to the first.

    If the li is 240px wide, then there is no real reason to add that width to the link inside.

    #260615
    ankitasg
    Participant

    You should use GTMatric tool to check this part of your website needs any optimization in CSS. If there is not, then you should not optimize this code as this may lead other functionality changes.

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