Please modify the height of the navbar to accommodate the placement of links in the center

I designed a navigation bar that resembles Rotten Tomato. The navbar consists of two rows: the first row contains links, and the second row includes a logo (with fixed width and height), a search bar, and additional links. While the layout of the first row is fine, I'm facing an issue with the second row where the link has the same height as the logo https://i.sstatic.net/iWVbu.png. How can I adjust the second row so that it looks like the original image (where the links in row 2 can spread in the same line and the navbar's height is not affected by the image height)? https://i.sstatic.net/yq7l7.png

@font-face {
  font-family: franklin;
  src: url(FranklinGothic.ttf);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: franklin;
}

nav {
  margin-top: 50px;
  width: 90vw;
  margin-left: auto;
  margin-right: auto;
  background: #1f1f1f;
  padding: 20px 30px;
}

nav a {
  display: inline-block;
  text-decoration: none;
  color: white;
}

nav .row1 {
  float: right;
}

nav .row1 a {
  margin-left: 20px;
  font-size: 14px;
}

nav .row2 {
  display: flex;
  align-items: flex-end;
  margin-top: 5px;
}

nav .row2 img {
  border: 1px solid red;
  height: 51px;
  width: 165px;
}

nav .row2 input {
  width: 400px;
  font-size: 16px;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' class='bi bi-search' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'%3E%3C/path%3E%3C/svg%3E") no-repeat 13px center;
  padding: 9px 4px 9px 40px;
  border-radius: 25px;
  border: 1px solid white;
  margin-left: 30px;
}

nav .row2 input::placeholder {
  color: white;
}

nav .row2 .links {
  margin-left: 30px;
  display: flex;
  align-items: center;
}

nav .row2 .links a {
  text-transform: uppercase;
  font-size: 16px;
  margin-left: 10px;
  border: 1px solid red;
}


/*# sourceMappingURL=style.css.map */
<nav>
  <div class="row1">
    <a href="">What's the Tomatometer&reg;?</a>
    <a href="">Critics</a>
    <a href="">SIGN UP</a>
    <a href="">LOG IN</a>
  </div>
  <div class="row2">
    <img src="/logo.png" alt="" />
    <input type="search" id="" name="" placeholder="Search movies, TV, actors, more.." />
    <div class="links">
      <a href="">movies</a>
      <a href="">tv shows</a>
      <a href="">rt podcast</a>
      <a href="">news</a>
      <a href="">showtimes</a>
    </div>
  </div>
</nav>

Answer №1

Assistance will be provided

.row2 {
 display: flex;
 align-items: center;
 margin-top: 5px;
 width: 100%;
 justify-content: space-between;
}

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

Error: The WebGL function enablevertexattribarray has an index that is outside the valid range

Take a look at the vertex and fragment shaders I've written: <script id="shader-fs" type="x-shader/x-fragment"> precision mediump float; uniform sampler2D uSampler; varying vec4 vColor; varying vec2 vTextur ...

Unlock the Potential of Bootstrap5 Carousel: Mastering Icon Movement

I'm utilizing the carousel from Bootstrap 5, and here is the image. https://i.sstatic.net/dpmjf.jpg The previous and next icons are overlapping with the text. I would like to reposition them, if possible, just above the upvote/downvote buttons. Howe ...

retrieve the identification number associated with a specific value

How can I retrieve the value of this ID, which is sent from the controller and displayed in the table? https://i.sstatic.net/UbdxT.png This is my HTML code: <tbody class="no-border-x"> <tr> <td id="id"></td> <td i ...

The best way to correctly present an HTML document within a UITextView

I am facing an issue with displaying an HTML document inside a UITextView in my iOS app. I have successfully converted the HTML document to an NSAttributedString using a specific extension. extension String { var htmlToAttributedString: NSAttributedStr ...

Is there a way to modify the color scheme of my webpage while utilizing Bootstrap?

As I delve into programming with Bootstrap, I encountered an issue while attempting to change the background color of my body. Even though I used the following CSS code: body { background-color: #eba; width: 100%; height: 100%; } The color change ...

Sending selected checkbox values to another JSP page with the help of JavaScript

I have some JSP code that I need help with. How can I pass checked checkbox values from a.jsp to b.jsp using JavaScript? Any assistance would be greatly appreciated. <html> <head> <meta http-equiv="Content-Type" content="text/ ...

Creating a form using Flexbox and responsive design

Looking to implement a responsive login form using Flexbox and achieve a design similar to the mockup images. How can I accomplish this? .wrapper { display: flex; flex-flow: row wrap; text-align: center; background: linear-gradient(to bo ...

Tips on formatting vueJS HTML5 with tidy without compromising its structure or content

Using the tidy tool on this VueJS code causes it to completely break: Here is the initial VueJS HTML code: $ cat sample_vue.html ... <tbody> <tr v-for="task in tasks"> <td><strong>{{task.title}}< ...

The navigation bar's HTML hue

Currently working on a website design and looking to replicate the unique color gradient effect seen in the top navigation bar of Virgin America airlines' website (refer to the image linked below). Interested in any CSS/HTML techniques that could help ...

How can you transfer data from a jQuery function to a designated div element?

I'm struggling to transfer data from a function to a specific div, but I can't seem to make it work. I'm in the process of creating a gallery viewer and all I want is to pass the counter variable, which I use to display images, and the total ...

Ways to dynamically manipulate HTML elements in Angular 5

Recently, I've been attempting to programmatically transform an HTML element. Strangely, when I update the transform value in the console tab, it changes successfully, but for some reason it doesn't reflect in the element tab of the browser. onD ...

Populate the dropdown menu with data from a JSON file

Recently, I created a custom JSON file and wanted to populate a select>option using this data. However, I encountered an error message saying: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:///C:/.../p ...

Switch back JSON in php script

After receiving a JSON object with an unspecified number of key/value pairs, I need to send it from my $.ajax function to a PHP script. The PHP script must then revert the JSON object and send it back to jQuery. {"First name": "John", "Contact": "2323",.. ...

When accessing tagName in Internet Explorer 11, the name will be returned in uppercase with the namespace included. However, in Internet Explorer 7,

My goal is to extract all child elements within a DOM element with a specific tag name and store them in an array. <xs:menu> <xs:submenu> </xs:submenu> </xs:menu> var item=menu.children.tags("XS:SUBMENU") ; Internet Explorer 7 ...

Is there a CSS3-compatible CSS parser available in C/C++?

Are there any C/C++ CSS parsers that currently support CSS3? I have come across a few, but none of them seem to offer full CSS3 compatibility. ...

Issues with aligning div elements centrally

I have a dilemma with aligning two divs on my webpage. I am trying to position the second div in such a way that it is centered between the first div and the end of the page, like this: | | | | | | | | | | | | | | div1 | ...

Concealing the resize handle icon using CSS

Consider a scenario where there is a table structure: <table> <tr> <th><div>Title1</div></th> <th><div>Title2</div></th> </tr> <tr> <td>< ...

Visibility of text compromised when placing transparent button inside input field

After adding a clear button inside the input box in Angular, I am facing an issue where the text in the input box is being overlapped and not fully visible. Below you will find detailed information on this problem. HTML Code <ng-template pTemplate=&quo ...

Encountering a vast expanse of empty white void

Attempting to create a scrollbar within my content div instead of the entire window seems to be causing a large white space in the content box, and I'm struggling to understand why. Can someone take a look and help me identify the issue? You can view ...

Combining a standard JSS class with Material-UI's class overrides using the classnames library

I am exploring the method of assigning multiple classes to an element in React by utilizing the classnames package from JedWatson, along with Material-UI's "overriding with classes" technique. For reference, you can see an instance in MUI's docu ...