• Resolved Fabinigames

    (@fabinigames)


    Hi all!
    I’ m trying to modify the navigation menu on header (The blue bar with Home…) and put a backround image to personalize.
    Really i don’t know why! But when i tryto define a background on stylesheet.css in the nav.main-menu line 308 adding the background: url (‘imageurl.format’); i can t see the background.
    If anyone can help, my website is https://www.reinosdeathavia.net

Viewing 12 replies - 1 through 12 (of 12 total)
  • background: url (‘imageurl.format’);

    That code does not look correct – see:

    https://www.w3schools.com/css/css_background.asp

    Hi!

    try
    background: url(‘images/my_background.png ‘);

    where ‘images’ is the folder sharing the same folder as your style.css file
    and my_background.png is the image (change png for gif or jpeg or what you have )

    Thread Starter Fabinigames

    (@fabinigames)

    Hi!
    We put the code correctly, but look like if any choose don t let the image been show.
    we has changed the code like in the tutorial, and is the same… don ‘ t works…

    nav.main-menu
    {
       background-image: url ('https://www.reinosdeathavia.net/wp-content/themes/annarita/images/barra.png');
       margin: 2px 2px;
       float: left;
       width: 100%;
    }

    The image is a bar.. u can see it: https://www.reinosdeathavia.net/modifycss/barra.png

    Please help we are working for few days and we can t solve this.. lol
    thanks a lot!

    Try using “background” not “background-image” :

    nav.main-menu
    {
       background: url('https://www.reinosdeathavia.net/wp-content/themes/annarita/images/barra.gif');
       margin: 2px 2px;
       float: left;
       width: 100%;
    }

    You also have some other CSS errors:
    https://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.reinosdeathavia.net%2F&profile=css3&usermedium=all&warning=1&vextwarning=&lang=en

    Thread Starter Fabinigames

    (@fabinigames)

    I’ ve not modified the CSS only the lane to add a background. Is this template useless? If u see, first time we tryed to do with “background:” comand.. i think somethink that don t let the image been wievied…

    Where are you adding that code to? You ARE modifying CSS if you are adding a background. Did you try the code I posted above?

    Thread Starter Fabinigames

    (@fabinigames)

    i’ m adding this code to change the bar background, to see my own image. i’m modifyng CSS but i think there is a code that is priorized than this. I tryed your code and nothing.

    You really should not be changing CSS in the theme file – your changes will be lost when the theme is updated. Instead you should be using a custom CSS plugin or a child theme.

    But I see the same code in your stylesheet – this line is wrong:

    background-image: url ('https://www.reinosdeathavia.net/wp-content/themes/annarita/images/barra.gif');

    It should be this:

    background: url('https://www.reinosdeathavia.net/wp-content/themes/annarita/images/barra.gif');

    Look on line 309 in your style.css file.

    I just tested it in Firebug and the corrected version works fine.

    Make sure you are clearing any caches after making any changes.

    Thread Starter Fabinigames

    (@fabinigames)

    WPyogi are u god? I love u! Really XDDDD

    LOL – no, not god! But thank you and you’re welcome.

    I also have a question regarding the Main Menu bar. Is there a way to “center” it & not leave a blank “bar” on my menu?

    My website is: https://sgt-christoff-golf-tournament.com/

    Thank you.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘How to change the nav main menu?’ is closed to new replies.