reegan29
reegan29

Reputation: 930

Semantic-ui menu alignment?

I am developing a website using semantic. I want to place my menu bar at Top of the website. I tried the below code. But it is not placing my Menu bar at the top. I see some space on top as well left side. I don't want this. Any one help me to fix this issue??

enter image description here

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>php userlogin tutorial</title>
<link rel="stylesheet" href="css/semantic.min.css">
<link rel="stylesheet" href="css/tab.min.css">
<script src="js/jquery.js"></script>
<script src="js/semantic.min.js"></script>
<script src="js/tab.min.js"></script>   
</head>
<body>
<nav class="ui menu">
    <a class="active green item">
        <i class="home icon"></i>Home
    </a>
    <a class="red item">
        <i class="user icon"></i> About us
    </a>
    <a class="blue item">
        <i class="photo icon"></i> Gallery
    </a>
</nav>
</body>
</html>

Upvotes: 3

Views: 4611

Answers (2)

Luis Fernando Rocha
Luis Fernando Rocha

Reputation: 83

Not sure if this was available back then, but now (I'm currently using version 2.1.8 and I'm not sure when it was added) you can use

<div class="ui top fixed menu">
   ...
</div>

No need for custom css
http://semantic-ui.com/collections/menu.html#fixed

Upvotes: 3

Ionică Bizău
Ionică Bizău

Reputation: 113345

Add some custom CSS for that:

.menu-top {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
}

And use the class in HTML:

<nav class="ui menu menu-top">
  ...
</nav>

JSFIDDLE

Upvotes: 1

Related Questions