Links repository

My goal is to create a layout similar to the one shown in this image: https://i.sstatic.net/DaXa0.png where there is one container for the top information and another container for links like NEWS.

The issue I am facing is that the links are not staying in a horizontal layout.

<!DOCTYPE html>
<html>
<head>
<style>

#header {
    background-color:black;
    color:white;
    text-align:center;
    padding:5px;
}
#tabLinks{
list-style-type: none;
 font-size: 14px;
 line-height: 18px;
 overflow-y:scroll;
 margin: 0 auto;
 position: relative;
 /*width: 890px;*/


}


#tabLinks li ul {
list-style-type: none;
  /*margin: 010px 0 ;*/
   display: inline;
    padding: 10px;
}



#footer {
    background-color:black;
    color:white;
    clear:both;
    text-align:center;
    padding:5px;  
}
</style>
</head>
<body>


<div id="header">
<h1>City Gallery</h1>
</div>

<div id="tabLinks"> 
   <ul>
     <div = class="a">
      <li><a href="index.html">Home</a</li>&nbsp;&nbsp;&nbsp;
      <li><a href=Blog.html>Blog</a></li>&nbsp;&nbsp;&nbsp;&nbsp;
      <li><a href=Terms.html>Terms</a></li>&nbsp;&nbsp;&nbsp;
      <li><a href=Privacy.html>Privacy</a></li>&nbsp;&nbsp;&nbsp;
     </div>
    </ul>
</div>

  

Answer №1

To address this issue, one effective method is to utilize inline-block for both the ul and li elements...

<!DOCTYPE html>
<html>
<head>
<style>

#header {
    background-color: black;
    color: white;
    text-align:center;
    padding:5px;
}
#tabLinks{
 font-size: 14px;
 line-height: 18px;
 overflow-y:scroll;
 margin: 0 auto;
 position: relative;
 /*width: 890px;*/
}

#tabLinks ul{
  display: inline-block;
}

#tabLinks li{
  display: inline-block;
  padding: 10px;
}

#footer {
    background-color:black;
    color:white;
    clear:both;
    text-align:center;
   padding:5px;  
}
</style>
</head>
<body>


<div id="header">
<h1>City Gallery</h1>
</div>

<div id="tabLinks"> 
   <ul>
      <li><a href="index.html">Home</a</li>
      <li><a href=Blog.html>Blog</a></li>
      <li><a href=Terms.html>Terms</a></li>
      <li><a href=Privacy.html>Privacy</a></li>
     </div>
    </ul>
</div>

  

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

The Wordpress theme is malfunctioning when accessed on the internet

After successfully installing WordPress and a theme, customizing it on my localhost, everything appears to be working fine on the PC where XAMPP is installed. However, when attempting to access the same page from another PC on the network, there seems to ...

Can the Bootstrap grid be arranged vertically?

I'm finding it difficult to work on a project with Bootstrap's horizontal grid system. What I want to achieve is to have my page divided into 4 sections, with the left side blocks having equal height and the right side blocks having varying heigh ...

What is the best way to extract data from a url after a callback has been implemented on an HTML page

I am working on an html page that receives a callback from a social service. Once the callback is implemented, I need to extract data from the url. Does anyone have suggestions on how to retrieve this data after the callback has been successfully impleme ...

Is there a way to use Jquery to determine if a parent div contains a scroll

I'm trying to find a jQuery example that checks if any parent div has a scroll bar, but I can't seem to locate a helpful one. Here is the code snippet I am working with: <div> <div class="heading"> <div class="visit ...

The HTML table is failing to display

I have a CSV file called travelq.csv and I'm attempting to automatically generate a table from the data it contains. The h1 heading is loading, but unfortunately, the table is not displaying as expected. I am unsure of where I may have made a mistake ...

When the browser back button is clicked, conceal the current div and reveal the previously hidden div

I'm faced with a situation where my website consists of multiple pages which I've achieved by displaying and hiding divs within a single html file. The issue I'm encountering is that the browser's back and forward buttons aren't fu ...

Setting intervals to change background images resulted in a delay

I've been working on creating an animation that switches between 2 images used as the background image of a div. Here's the code snippet I've been using: var spacecraftInterval = setInterval(function() { if (access == true) { var image ...

Darkening effect observed in iOS Safari when applying CSS gradient on a background with similar color tone

I am facing an issue with the gradient overlay on my blue box. I want the overlay to fade from transparent to blue at the bottom of the box, creating a smooth transition for overflowing text. This is how it is supposed to appear (and does on most browsers ...

`Troubleshooting Problems with HTML5 Video Playback on Mobile Safari`

I have encountered a unique situation: Currently, I am developing a "kiosk" application in Safari that features two videos. One acts as a screensaver while the other is supplementary. The screensaver video loops perfectly using: (done on body onload="init ...

What is the best way to align a Font Awesome icon within an SVG circle?

Can anyone help me position the trophy inside the circle, just below the number 2000? <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1b7974746f686f697a6b5b2e352835 ...

Guide on retrieving JavaScript variables in a JSON response and showcasing their values on a web page

I need to show the data from a JSON response: item.php $ItemList = array(itemcode=>EATERY, itemname=>'Popcorn') ; $ItemDisplay = " '<div>' + document.write(this.itemname) + ' - ' + ...

Adjusting CSS using JQuery based on scroll position

I am attempting to dynamically change a CSS style depending on the viewer's position on the page. Despite researching numerous similar threads online, I have not been able to get this code to work as intended. Any assistance would be greatly appreciat ...

Strange fuzzy ring on Safari IOS HTML5 videos

There is a strange circular shape that keeps appearing on certain websites (image below) when viewed on an iPhone using Safari. Upon inspecting the Safari console, it seems to be related to the autoplay feature of a video, but unfortunately, I have been un ...

Tips for maintaining a border between divs in a bootstrap layout

I have a box positioned on the left side of the screen and a large div element placed adjacent to it. I am looking to enclose both of these elements within a square-shaped border in a light color. How can I achieve this effect? Additionally, I have include ...

Can the minimum length be automatically filled between two elements?

I'm struggling to find a way to adjust the spacing of the "auto filling in" dots to ensure a minimum length. Sometimes, on smaller screens, there are only one or two dots visible between items. Is there a way to set a minimum length for the dots in th ...

In the event that the identifier changes, initiate a fresh iteration of the loop

My query is returning several lines with the same id. Here's an example of the output: Id Amount Owed Description 552 50.00 Diapers 552 35.00 Lotion 545 23.00 Pen 545 15.00 Notebook Currently, I'm looping in Javascript to display t ...

How do I attach an event listener to a select box that is created dynamically using JavaScript?

I'm new to web development and I'm currently working on a project where I need to create a select box dynamically within a div that is also created dynamically when the page loads. However, I'm facing an issue with adding an onchange Event L ...

Accessing the complete row in the editable table feature of MindMup

Recently, I started using the editable table feature from mindmup which can be found at github.com/mindmup/editable-table. My current challenge involves posting an entire row to a different URL. Since I am relatively new to javascript, I am facing some dif ...

Adjust the width of a div element to match its content when nested within another div element

I am looking for a solution in the provided code snippet where the width of the .content div can automatically adjust to fit the .product divs inside it. It is important that the width adjusts dynamically as there could be different numbers of products an ...

Deactivating a button if the input fields are blank using ReactJS

Hi there, I'm new to reactJS and recently encountered an issue with my code. Everything seems to be working fine except for the NEXT button not being disabled when text fields are empty. My expectation is that the NEXT button should only be enabled af ...