transparent menu-items on different header-images

Hello, I'm creating a website in HTML/bootstrap 3.3.x. I do have 5 menu-items (Home-contact-about me etc.) and on each page I want a different header-images (1920x550px) . In this header-image the menu-items should be transparent (to the right side) starting about 25px from the top of the side. I have tried it several times but I do not get it right, some help is very welcome. Thank You

Kind regards, Jos

PS. some history: If I use a background-image, I can create a transparent navbar incl. menu-items. Unfortunately it is impossible to use at every page a new-different header-image.

I'm not totally sure how you have things built but if you go the background-image route, you can specify a different class on the body element for each page.

For example if you have a class on your header section such as .header-img you'd simply put a class on the body element for page one something like .page1 or something related to the bg image if you will.

Then write your CSS like

.header-img{
  background-repeat: no-repeat;
  background-size: cover;
}
.page1 .header-img{
  background-image: url(/page1-header.png);
}
.page2 .header-img{
  background-image: url(/page2-header.png);
}
.page3 .header-img{
  background-image: url(/page3-header.png);
}

etc...

If you could provide a little more info and how things are laid out or coded that would help in giving more direct help.

Saj

Hi Saj, Thank you for your reply. Yes, I thought myself , somewhat, in that direction, but I have the header-image put into jumbotron (as a background-image), and it did not work. Maybe I should follow your clue given in your email.? I will see tomorrow if I can work that out ? (its now a half hour past midnight). Perhaps I can give you the test-website for more clarity.? ( www.josbogers.nl/_bootstrap ) It is in the Dutch language. The website is under construction and I have also some troubles to some menu-item links (the link for IT-Consultancy does not work and gives an error). Perhaps you may get a better impression about my wishes as you see the website. . The menu-item <Home> is the index.html. It has the right header-image. All the other pages has still the same image-header , but should get a different image for each page. The size should be 1920 x 500px .<br /> Kind regards, Jos

Ok, so real quick. There are links in your nav that are not constant. For instance on one page the nav links to IT-Consultancy.html and on another page nav links to it-consultancy.html.

You need to go through your nav code and make sure that the links are linking to the correct spelling and case of the file your trying to link to. It's pretty good practice to have your files all lowercase and so it's easy to remember how the links go because you then link make your links lowercase too.

Saj

For your background image method you'd do something like this.

.jumbotron {
    background-size:cover;
    background-position:center center;
    color:rgb(255,255,255);
    margin-top:30px;
}

.home .jumbotron {
    background-image:url(../img/lotrKlein.jpg);
}

.aboutmax .jumbotron {
    background-image:url(../img/[aboutmax header image]Klein.jpg);
}

.it-consultancy .jumbotron {
    background-image:url(../img/[it-consultancy header image]Klein.jpg);
}

.particulieren-dienst .jumbotron {
    background-image:url(../img/[particulieren-dienst header image]Klein.jpg);
}


@media (min-width: 768px) {
    .home .jumbotron {
        background-image:url(../img/lotrMiddel.jpg);
    }
    .aboutmax .jumbotron {
        background-image:url(../img/[aboutmax header image]Middel.jpg);
    }

    .it-consultancy .jumbotron {
        background-image:url(../img/[it-consultancy header image]Middel.jpg);
    }

    .particulieren-dienst .jumbotron {
        background-image:url(../img/[particulieren-dienst header image]Middel.jpg);
    }
}

I hope that helps you figure out what you might need to do.

Saj

Hi Saj, Thank you for your replay. I spent the whole day working on it and to reveal the background images. I do not know what I further should do that the images will be visible in the website? I made a new test webside < www.josbogers.nl/_bootmax> in which I have tried to solve the problem with the explanation from you. It looks intelligibly but i'm not sure how I can fix it. In the testside I have tried it you may seen that in index.html , aboutmax.html (overons) and the others.

I have create a new stylesheet : <link rel="stylesheet" type="text/css" href="css/background-images.css"> In what I put the data you've sent me . But as that did not help , I've also put the same instruction in the page itself.

.aboutmax .jumbotron I put this in the page aboutmax in the jumbotron . see below: <!-- jumbotron for for the aboutmax-page --> *

<div class="aboutmax jumbotron"> <div class="container"> <h1>Over Datax - IT</h1> <h3>Max Bogers eigenaar </h3>

is het eerste deel van een filmtrilogie The Lord of the Rings, gebaseerd op J.R.R. Tolkiens gelijknamige boek. Het verhaal vertelt over de hobbit Frodo Balings, die een magische ring moet vernietigen voordat de duistere Sauron hem terugvindt.

    <p><a>Lees meer &raquo;</a></p>
  &lt;/div&gt;
&lt;/div&gt;

*

What do you mean by : [aboutmax header image] ? where must I use this ? background-image:url(../img/[aboutmax header image]Klein.jpg);

Sorry, unfortunately I do not understand the meaning of this ? perhaps a matter of my age (78 yrs) or too little knowledge at my side?

Would you be so kind to give me a hint as you did before. Thank you and kind regards, Jos

Don't worry @zjoskebest we'll get this working for you. :)

Ok, so what I sent in my last post was an example of how you would change your CSS to get different images to show based on the page you were on at the time.

So let me see if I can break this down a little more.

  1. On every page that you have the jumbotron, change them back so it's just like this <div class="jumbotron">
  2. Then on the Home page, file index.html, change the BODY element <body> to <body class="home">
  3. Then on the aboutmax page, file aboutmax.html, change the BODY element <body> to <body class="aboutmax">
  4. Then on the it-consultancy page, file it-consultancy.html, change the BODY element <body> to <body class="it-consultancy">
  5. Then on the particulieren-dienst page, file particulieren-dienst.html, change the BODY element <body> to <body class="particulieren-dienst">

Now that is the start of what we need to do to get this moving in the right direction.

Next thing, unfortunately, I don't know what are all the background images file names so I gave example coding in which it was intended that you replace the example coding for the images file name with your actual image files name.

For example when you see someone write something like background-image:url(../img/[aboutmax header image]Middel.jpg); the intent was that you replace the section [aboutmax header image] with the actual image name of the file that you wanted that page to show. I didn't know if the part of the file name "Klein" and "Middel" meant something like large and medium in Dutch. That's kind of what I was thinking but I'm sure I'm wrong :) was taking a wild guess there :)

If you where to give me the file names of the images you wanted as the background images for the jumbotron, I could rewrite the CSS code I gave you with the correct image names.

Saj

Hi Saj, Thank you for your help. The reason I do all this is because I would like to make some impression on my grandson 18 years (nearly 19 in January). The website will be later his. So I started training in: bootstrap / html - joomla and wordpress, because I did not know which is for me the easiest . After months of studying it appears to be : bootstrap/html ??

Now I come to your explanation of the body. I bring back the jumbotron per page in class=”jumbotron” Also, with respect to, the items 1-5 are 100% clear to me. The names of the images ,should be all 1920x550 size, see below. Because somebody has told me that this measure would be giving a suitable screen for the PC and its derivatives also for the tablet and mobile devices? the images: Datax-header.jpg (for the index.html ) Overons.jpg (for aboutmax.html page) Particulier.jpg (for the page particuliere-dienst) It-consultancy.jpg (naturally for it-consultancy page) Also : Zakelijk.jpg ( for the page zakelijkedienst and also suitable for the 4 sub pages of these main-menu-item ) Contact.jpg (for the page contact , in which the contactform is set)

Your guess with respect to “middel” (= medium) and “klein” (=little) were almost right as you could see. There are still 2 pages more, <zakelijkedienst> (= business service in English) and <contact>, I’ve omitted the latter because I did not find yet a working contactform example in bootstrap. In what name-phone- email and messages at least should be available. And a reset-button and submit . I have made an bootstrap form, but this is not working with respect to submit. The zakelijkedienst - menu-item is not working as it should be . It’s a dropdown menu as you could see but it should have two functions . Clicking on it , the page (zakelijkedienst) should open, and hover over the item , the 4 sub-menu-items appears and one can made a selection which one you need. I hope that what I've meant above , are written in understandable english? Thanks again and wishing very good regards, Jos

This is your updated stylesheet file. Update the file named stijlLOTR.css with the following code. You also need to go through your HTML files and remove all the embedded stylesheet content that begins and end with these tags <style> and </style>. You shouldn't have any of that on your HTML pages because it's adding to confusion and conflicts with coding you're trying to use in stijlLOTR.css. Also remove the background-images.css code you have in your HTML pages. Stick with putting your CSS in the stijlLOTR.css file.

@charset "UTF-8";
@import url(http://fonts.googleapis.com/css?family=Cinzel+Decorative);
@import url(http://fonts.googleapis.com/css?family=Smythe);
/* CSS voor Bootstrap LOTR */
body {
    background-color:rgb(240,255,245);
}

.jumbotron {
    background-size:cover;
    background-position:center center;
    color:rgba(255,255,255,0.5);
    margin-top:30px;
}

.index .jumbotron {
    background-image:url(../img/datax-header.jpg);
}

.aboutmax .jumbotron {
    background-image:url(../img/overons.jpg);
}

.it-consultancy .jumbotron {
    background-image:url(../img/it-consultancy.jpg);
}

.particulieren .jumbotron {
    background-image:url(../img/particulier.jpg);
}

.zakelijkedienst .jumbotron {
    background-image:url(../img/zakelijk.jpg);
}

h1 {
    font-family: 'Cinzel Decorative', cursive;
    text-rendering: optimizelegibility;
}

h2 {
    font-size:29px;
    color:rgb(0,102,51);
    font-family: 'Smythe', cursive;
}

h3 {
    font-family: 'Smythe', cursive;
}

.col-lg-3 img {
    width: 100%;
    border-radius:9px;
}

/* Extra small devices (phones, up to 480px) */
/* Bootsstrap is Mobile First */


/* Small devices (tablets, 768px and up) */
/* This looks to be unncessary so I'm commenting it out */
/*
@media (min-width: 768px) {
    .home .jumbotron {
        background-image:url(../img/lotrMiddel.jpg);
    }
}
*/

@media (min-width: 768px) and (max-width: 992px) {
    .jumbotron {
        margin-top: 60px;
    }
}

/* Medium devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .jumbotron {
        background-image:url(../img/datax-logo3-groot.jpg);
    }
}

/* Large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {

}

/* het menu */
.navbar {
    background-color:rgba(0,102,0,0.7);
}
.navbar-inverse .navbar-nav > .active > a {
    background-color: rgb(0,51,0);
}
.navbar-inverse .navbar-nav > li > a {
    color:rgb(255,255,202);
}

.navbar-inverse .navbar-nav > li:hover {
    background-color:rgb (204,102,0);
}

.navbar .dropdown-menu {
    background-color: rgb(204,204,0);
}

.dropdown-menu > li > a:hover {
    background-color: rgb(204,102,0);
}


/*formulier invul veld*/
input.form-control {
    background-color:rgb(204,102,0);
    font-style:italic;
}
.navbar input.form-control::-webkit-input-placeholder {
    color: #fed;
}
.navbar input.form-control:-moz-placeholder { /* Firefox 18- */
   color: #fed;  
}
.navbar input.form-control::-moz-placeholder {  /* Firefox 19+ */
   color: #fed;  
}
.navbar input.form-control:-ms-input-placeholder {  
   color: #fed;  
}
/* knoppen in de inhoud */
a.btn-success {
    background-color:rgb(0,102,0);
    border-color: rgb(0,51,51);
}
a.btn-success:hover {
    background-color:rgb(0,153,0);
    border-color: rgb(0,51,51);
}

footer {
  background-color:#0e540f; color:#fff;     position: absolute;
    width: 100%;
    left: 0;
}
 .full-width-div {
    position: absolute;
    width: 100%;
    left: 0;
}

.voet{
  color:#ff6600;
}

.kleur2{
  background-color: rgba(14,84,15,.5)
}

Regarding the navigation dropdown. By default Bootstrap makes the Nav dropdowns work by clicking and not mouseover. To save some head aches with it, just reword the dropdown and make a submenu link for that page instead.

Saj

Hi Saj, Eureka !! I think it works. Thank you very much.I learned a lot by your clear explanation. So I will be sometimes a crack. :)Lol . Not yet all pages will show the header image, but that is probably an error in assigning names from me.? You were a great help to me. Meanwhile, I read your previous mail four - five times and tested and I thought I understood 95%.

Regarding the dropdown I will execute your instructions. Tomorrow I go to Max (his sister's birthday) with a happy smile. I like as he say "your are great Grandpa" and I'll tell him of your fine help, honestly! For the record, I should like to reveal to the next: Max is a student, for the time being ( for 4-5 years) and want to work a little to pay his studies (partially) themselves. Again thanks, Jos

Hi Saj, Sorry ! I come back to the solution in the css. In my localhost test environment (starting point for my adjustments), it sometimes occurs that the height of the header image does not always show the correct height and is the lower part of the image cut off, while the height of each image is 550px . I could not figure out why. I have since made a height in the jumbotron css of 550px and for the mobile device, I gave a height of 200px ? What do you think? kind regards Jos

That seems like it would be fine. Glad to hear that it's starting to come together for you :)

I hope you all had a good time celebrating Max's sisters birthday :)

Saj