Ways to increase the spacing between several menus

Need help with spacing between menus

Tried using margin left and margin right but it's not working

File: _Layout.cshtml

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title - My ASP.NET Application</title>
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")
<style>
  /*  .space{
       margin-left:5px;
    }*/
</style>

</head>
<body>
    <div class="navbar-fixed-top">
        <div class="col-md-12">
            <a link href="" style="font-size:20px;">ABCD Technology</a>
        </div>
    </div>

    <div class="row">
        <div class="col-md-12">
            <div class="row">
                <div class="col-md-8"></div>
                <div class="col-md-4 space">
                    <div style="margin-right:20px;"></div>
                    @Html.ActionLink("Home", "Index", "Home")
                    @Html.ActionLink("Services", "Index", "Home")
                    @Html.ActionLink("PortFolio", "Index", "Home")
                    @Html.ActionLink("About", "Index", "Home")
                    @Html.ActionLink("Hire Developer", "Index", "Home")
                </div>
            </div>
        </div>
    </div>

    @RenderBody()

    <div class="navbar-fixed-bottom" style="margin-left:45px;">
        <footer>
            <p>&copy; @DateTime.Now.Year - <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1e5d716e674c7779766a5e78726a307d7173">[email protected]</a></p>
        </footer>
    </div>
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/bootstrap")
    @RenderSection("scripts", required: false)
</body>
</html>

site.css

body {
    padding-top: 50px;
    padding-bottom: 20px;
}

/* Set padding to keep content from hitting the edges */
.body-content {
    padding-left: 15px;
    padding-right: 15px;
}

/* Override the default bootstrap behavior where horizontal description lists 
   will truncate terms that are too long to fit in the left column 
*/
.dl-horizontal dt {
    white-space: normal;
}

/* Set width on the form input elements since they're 100% wide by default */
input,
select,
textarea {
    max-width: 280px;
}

https://i.sstatic.net/o2z8s.png

Also tried the following code with no success:

<div style="margin-left:5px;"></div>

Using an external CSS class like:

<style>
  /*  .space{
       margin-left:5px;
    }*/
</style>

but still facing issues.

See image above for reference, attempting to add space between menus

Is there a change needed in the site.css class or is the menu design incorrect?

Answer №1

Kindly update the code snippet.

<style>
  /*  .space{
       margin-left:5px;
    }*/
    
</style>

UPDATED BY

<style>
.space a{ margin:0 7px; display: inline-block; }        
</style>

Answer №2

Give this a shot:

<style>
  /*  .space a{
       padding: 10px;
    }*/
</style>

This code snippet will add padding to the entire a tag.

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

Using AJAX to dynamically load an image by setting the image path as the source of the image tag

I'm facing a challenge with my AJAX call that is used to display user details in a modal. I recently integrated an image upload feature for users, but now I'm struggling to display the uploaded image. I have tried looking for solutions online, bu ...

The process involves transferring information from a specific div element to a database. This particular div element obtains its data after receiving an appended ID

It's a bit complicated, but I'm working on creating a tag system. I'm fetching data from a database with an AJAX call using the "@" symbol. Everything is working fine - the tags are being generated, but I'm having trouble retrieving and ...

When working with ajax, you can easily refer to elements by using the $(this)

I am having trouble using the $(this) selector in the ajax success function to target the element with the class .selectclass that was double-clicked before. Any suggestions on how to make this work within the ajax success function? Here's the jQuery ...

CSS First Element

"When an element with a specific id has a first-child descendant that is any of the heading tags (h1, h2, h3, h4, h5, or h6), apply the following CSS styles:" I have come up with the following selector: #content:first-child h1, #content:first-child h2, ...

"jQuery enables hover effects to be applied to elements that are not directly related

I'm attempting to achieve an effect where an element will show or hide when I hover over a completely different element. Currently, my approach involves using lists and indexes so that the nth item in list 2 changes when the nth item in list 1 is hov ...

Avoid using jQuery when implementing a new form

Consider a scenario where you have an input field: <input type="text" id="smth" value="" /> and you are using jQuery to send this data to a .php file. $("#submit_button").click(function() { var info = {}; info['smth'] = $(& ...

Preserving the position of inline text

I've been working on a button design that I want to make look more realistic by moving the text down 1px inside the button when it's pressed. To achieve this effect, I added an extra pixel to the top and removed one from the bottom. However, the ...

Creating equal height for two element children using CSS

As I construct a pricing table, I'm faced with the challenge of ensuring that the child elements within each row are of equal height. The website is built on WordPress and utilizes a page builder, resulting in the row fields being positioned different ...

What is the purpose of using double % in Java or JSP?

Yesterday, while reviewing some code, I came across a line that seemed very peculiar to me. In a JavaScript function, there is a condition checking for a string passed as a parameter in the following manner: "%%unsubscribe%%". See the snippet below for re ...

How to implement jquery select functionality on clickable table rows?

I've come across a challenge while trying to implement clickable table rows with the jquery selectable function. Everything works perfectly fine with li elements, but I seem to hit a roadblock when using tables - the click event just stops working. Wh ...

Encountering a surprise syntax error while trying to reference JavaScript from HTML?

After downloading this code from Github to make some modifications, I decided to run it locally. Link to the downloaded file The main index.html file references the JavaScript using: <script type="text/javascript" src="app.0ffbaba978f8a0c5e2d0.js">& ...

How come using float:right causes the div to float towards the left instead?

I am new to CSS and currently facing a problem with positioning a div (#inner) in the bottom-right corner of another div (#container). Initially, I used float: right;, but upon inspecting the Html, I noticed that the inner div is appearing in the bottom-le ...

Display the div element only when the mouse is hovering over the button

I need a hidden text inside a div that will only appear when the mouse pointer is hovering over a specific button. Here is my current code: // Show help-text on hover $("#help-container") .mouseover(function(e) { $(this).find("#help-t ...

Is it possible to create an array that organizes monthly income data from a JSON file?

I'm currently developing an Accounting System where I need to display a bar chart showing the monthly Incomes and Expenses. The data is retrieved from a database using AJAX, and it returns the following JSON: { "results":{ "his ...

Placing emphasis on a link's destination

Is there a way to automatically focus on an input field after clicking on a local href link? For example, I have the following: <a href="#bottom"> Sign up </a> And at the bottom of the page : <div id="bottom"> <input type="email" nam ...

Swimming Left and Right Arrows

I am struggling to create a layout where images are stacked horizontally, with small arrows centered vertically on the left and right sides for scrolling. However, the arrows are currently centered relative to the page, rather than to the center image. I ...

Mysterious issue causing PHP $_POST to return null

Having a bit of trouble with my PHP $_POST that keeps returning a null or empty value. Although I can't seem to spot any mistakes in my code (I know they are there somewhere), I'm on a time crunch and can't take a break. So, I was hoping som ...

Utilizing shared components with withStyles and material ui components

I'm currently working on a project using React, TypeScript, and Material UI. Here is the layout I have: <MuiThemeProvider theme={muiTheme}> <My Component/> </MuiThemeProvider> Within my component, the code looks something ...

Running a CSS keyframes animation can be achieved by removing the class associated with it

Is there a way to reverse the CSS animation when a class is removed? I'm trying to achieve this on my simple example here: https://codepen.io/MichaelRydl/pen/MWPvxex - How can I make the animation play in reverse when clicking the button that removes ...

Tips for incorporating the numerous values of a one-to-many relationship into an HTML template using Django

I am facing an issue with a one-to-many relationship in my Django project. Here is how it is structured: class Listing(models.Model): title = models.CharField(max_length=60) class Images(models.Model): listing = models.ForeignKey(Listing, on_delet ...