Incorporating a recurring image beneath a navigation menu

I'm attempting to recreate a header that has a similar appearance to the following:

https://i.stack.imgur.com/uVXs3.png

However, I am facing challenges in generating the repeating diamond design beneath the black bar. The diamond pattern resembles this:

https://i.stack.imgur.com/bisH4.png

Below is the current HTML and CSS code I have written for this test version:

    figure {
      background: black;
      border-radius: 3px;
      height: 50px;
      margin: 0px;
    }
    html {
      background-color: grey;
      width: 1212px;
      height: 1476px;
      margin: auto;
    }
    img {
      border-radius: 100%;
      position: relative;
      vertical-align: middle;
      left: 50px;
      bottom: 30px;
    }
    figcaption {
      display: inline-block;
      vertical-align: middle;
    }
    li {
      display: inline-block;
      text-decoration: none;
      overflow: hidden;
      margin-bottom: 50px;
    }
    a {
      list-style: none;
      text-decoration: none;
      text-align: center;
      color: white;
    }
    ul:first-child {
      float: left;
      margin-left: 100px;
    }
    ul:last-child {
      float: right;
      margin-left: 550px;
    }
    div {
      background-color: blue;
      width: 100%;
      height: 70px;
    }
<div></div>
<figure>
  <img width="100" height="100" src="http://i.imgur.com/HiCMdId.png" />
  <figcaption>
    <ul>
      <li>
        <a href="">test</a>
        <a href="">test</a>
      </li>
    </ul>
    <ul>
      <li><a href="">test</a>
      </li>
      <li><a href="">test</a>
      </li>
      <li><a href="">test</a>
      </li>
      <li><a href="">test</a>
      </li>
    </ul>
  </figcaption>
</figure>

Answer №1

I recommend setting the image as the background of a div that covers the entire width of the navigation bar. You can then eliminate the image source from the HTML code.

Here is an example of how your CSS should look:

menu {
   background-image: url('http://i.imgur.com/HiCMdId.png');
   background-repeat: repeat-x;
   width: 100%;
}

Answer №2

Here is my solution using the ::after pseudo-element. Keep in mind that if you have multiple figure elements on your page, they will all inherit this background unless you specifically override the styles for each one.

figure {
  background: black;
  border-radius: 3px;
  height: 50px;
  margin: 0px;
  position: relative;
}
figure::after {
  content: ' s';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: url(https://i.stack.imgur.com/bisH4.png) repeat-x 0 0;
  z-index: -1;
  display: block;
  color: transparent;
  background-size: 10px 10px;
}
html {
  background-color: grey;
  width: 1212px;
  height: 1476px;
  margin: auto;
}
img {
  border-radius: 100%;
  position: relative;
  vertical-align: middle;
  left: 50px;
  bottom: 30px;
}
figcaption {
  display: inline-block;
  vertical-align: middle;
}
li {
  display: inline-block;
  text-decoration: none;
  overflow: hidden;
  margin-bottom: 50px;
}
a {
  list-style: none;
  text-decoration: none;
  text-align: center;
  color: white;
}
ul:first-child {
  float: left;
  margin-left: 100px;
}
ul:last-child {
  float: right;
  margin-left: 550px;
}
div {
  background-color: blue;
  width: 100%;
  height: 70px;
}
<div></div>
<figure>
  <img width="100" height="100" src="http://i.imgur.com/HiCMdId.png" />
  <figcaption>
    <ul>
      <li>
        <a href="">test</a>
        <a href="">test</a>
      </li>
    </ul>
    <ul>
      <li><a href="">test</a>
      </li>
      <li><a href="">test</a>
      </li>
      <li><a href="">test</a>
      </li>
      <li><a href="">test</a>
      </li>
    </ul>

  </figcaption>
</figure>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

HTML: Launch Frameset in a Separate Tab or Window

I have encountered an issue with using FRAMESET. Situation: Within my frameset, I have a menu with 5 links. When I click on the home page, everything looks fine. However, when I open it in a new tab or window, the design is not displayed. Is there a way ...

Is there a way to have my MUI Typography component display a unique image cursor when hovered over?

After some testing, I found that setting the cursor to cursor: pointer works perfectly fine. However, my goal is to use a custom image as a cursor. The image is saved in both my src and public folders, but I seem to be struggling with the syntax when using ...

The PDF file cannot be displayed due to the dynamic loading of the path and filename

Currently, I am working on an AngularJS and Java application. The following HTML code is utilized to open a PDF file in the browser. However, there seems to be an issue where the PDF does not open when dynamically passing the value for the data attribute. ...

Tips for utilizing SeleniumRC within JUnit framework for elements with dynamically changing IDs

I'm currently in the process of automating a workflow and I need to click on a link within a table row. The challenge is that all links within the rows share the same element ID, and the source code has a JavaScript code snippet like this: ("Element I ...

My component reference seems to have gone missing in angular2

Trying to load my Angular 2 app, I encountered this error: https://i.stack.imgur.com/FmgZE.png Despite having all the necessary files in place. https://i.stack.imgur.com/kj9cP.png Any suggestions on how to resolve this issue? Here is a snippet from ap ...

Responsive div not displaying background image

Here is a straightforward and easy-to-understand code snippet: HTML markup: <div class="jumbotron text-center top-jumbotron"> </div> CSS: .top-jumbotron { background: #ffcc00; background-image: url('../../bootstrap/img/home-pag ...

The function of page-break-after: always is not functioning correctly

I want the Div with class questions_visual to appear on the second page when printing. <html> <head> <title>quiz</title> <link rel="stylesheet" href="style.css"> </head> <body> < ...

I'm having trouble viewing my display:table-cell content because Internet Explorer is hiding it

I am attempting to align an icon vertically centered and far right inside a container. I currently have code that achieves this using ::after and table-cell properties. However, the content does not display in Internet Explorer. If I remove the display:tab ...

Unable to remove the initial item from my shopping cart

Currently working on my computing science assignment and decided to create an online store. I followed a tutorial to implement the shopping cart functionality, but I'm facing an issue. I can delete every item in the cart except for the first one that ...

No feedback received after sending keys using Selenium

Whenever I execute my code using PhantomJS and Selenium, the result appears to be correct. However, when it comes to using send_keys function, the code gets stuck without any errors, answers, or progress. I am puzzled and eager to find out why this is ha ...

What is the method for utilizing the onmouseover function to emphasize a specific part of an SVG graphic?

I am attempting to create an interactive SVG map of Europe. Each country is represented by a path element, and I want the opacity of a country to change to 0.5 when it is hovered over. Despite trying to define a JavaScript function for this purpose, noth ...

Tips for integrating SASS from the Bulma package into an Angular application

I'm currently working on implementing Bulma into my project. The documentation suggests using NPM to obtain it. yarn add bulma Further in the documentation, there is an example provided with code snippets like the ones below. <link rel="styles ...

When a user hovers over the image, a button is revealed

I have a test page on my website: If you'd like to check it out, feel free to visit: I am trying to create a feature where when you hover over an image, a black button with text and links will appear. When you move your mouse away from the image, ...

What is the best way to animate an element when it comes into the user's view

In order to activate the animation of the skill-bars when the element is displayed on the website, I am seeking a solution where scrolling down through the section triggers the animation. Although I have managed to conceptualize and implement the idea with ...

Tips for modifying a text input in a list

Managing comment boxes and buttons for each box can be a bit tricky. Clicking on the edit button should enable only that specific textbox, while save or cancel actions should hide the text box and show "<p></p>". Below is my ng-template where ...

Preserving Scroll Location Through Back Button Usage and Ajax Manipulation of the Document Object Model

Currently, I am incorporating a feature where results are loaded in using ajax with an infinite scroll. However, there is an issue when a user clicks on an item in the list and navigates away from the page - upon returning by clicking the back button, they ...

Disappearance of external page upon refreshing - jquery mobile

I'm in the process of developing a jQuery mobile application that loads external pages into a specified div when a link is clicked. These externally loaded pages contain links to additional pages. However, I've noticed that when I click on these ...

Incorporating and designing an external document

Another website has a file that I would like to include in one of my own pages. The URL format is as follows: http://example.com/path/with/some/variables I could use an iframe to accomplish this, but I also want to customize the CSS of elements within th ...

What is the best way to integrate an admin template into a website without relying on popular CMS platforms like WordPress?

Do I need to use a WordPress system in the backend in order to utilize an admin template? I've noticed that there are several sleek web admin templates available in Bootstrap. I'm interested in using one of them but unsure how to do so without re ...

"Seeking assistance with concept sharing and content transmission. In need of guidance

Basic Question I'm stuck trying to brainstorm a concept to reach my objective. I am having trouble figuring out how to navigate the DOM correctly with my chosen method. The Objective First, let me explain what I am doing: I use ajax to bring HTML ...