• Resolved mzimmers

    (@mzimmers)


    Hi –

    For some reason, my browser is ignoring my margin settings for a navigation list. It is, however, responding to padding settings that are in the same line of CSS code. Can someone tell me what’s going on here?

    https://www.scopedin.com/wordpress

    The line in question is line 336 of my style sheet; for those who don’t want to bother looking at the file, here is that line:
    #navmenu ul li a {text-decoration:none; margin: 1px 0px 10px 0px; padding:6px 28px 4px 28px; color: black; background: #e3eef0; border: solid 1px black; }

    The reason I say it’s not responding to the margin setting is that the stuff below it, which comes from the sidebar files, jams into it.

    Any help? Thanks…

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter mzimmers

    (@mzimmers)

    Well, I have discovered why the margin statement wasn’t taking effect, but I don’t fully understand it. The CSS for the list *item* specified a margin, but the CSS for list itself specified no bottom margin.

    What I don’t understand is, shouldn’t the margin statement for the list item “override” the margin statement for the list?

    Thanks for any clarification.

    Thread Starter mzimmers

    (@mzimmers)

    I’m seeing another instance where the CSS doesn’t seem to be cascading the way I expect it to. This time it has to do with padding and margins for list items that are displayed within a sidebar (I’m using the wswwpx_fold_page_list widget).

    I guess the general question is, doesn’t the “cascading” feature of CSS imply that a directive that is “nearer” to the content to be displayed take priority? I have padding and margins explicitly set in my <li> formatting, but it’s not taking effect. The only thing I can think of is that it’s being suppressed because of incompatible formatting of the sidebar, but I’d expect the code in the <li> to take priority.

    Anyone?

    https://www.scopedin.com/wordpress

    The CSS is in two files, style.css and custom.css. Thanks for any help…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘margins not working in navlist’ is closed to new replies.