5
So, I’m a beginner in Web Design, and I’m having some problems with css on a site that I’m developing.
I have to make a fixed menu, which is nothing more than a normal bar, but which has a figure of a trapezoid in its center and inside it, a search box, as in the photo. My question is this::
How could I do this the right way to get responsive? Initially, I left the menu fixed
, and created a div pro trapeze and left as absolute
, but if the screen decreases, the input
of the research "flees" from the center of the trapeze. Could someone help me or give me a hint of how I could do?
<html>
<head>
<meta charset="utf-8"/>
<title>Site</title>
<link rel="stylesheet" type="text/css" href="dist/css/bootstrap-theme.min.css">
<link rel="stylesheet" type="text/css" href="dist/css/bootstrap.css">
<script type="text/javascript" src="dist/js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="dist/js/bootstrap.min.js"></script>
<style>
header {
background-color: #017338;
height: 60px;
padding: 0.5em;
position: fixed;
top:0;
width: 100%;
}
header p {
color: #fff;
}
.navbar-brand img {
margin-top: 5px !important;
}
#navbar li, #navbar a, .navbar-brand img {
padding:0 !important;
line-height: 60px;
color: #fff;
}
#navbar li input {
line-height: 10px;
width:15em;
margin-top:1.5em;
border:0;
}
#jogos button {
margin-top:5em;
}
#thumbs {
margin-top:11em;
}
#thumbs img {
height:200px;
width:300px;
}
@media (min-width: 1000px) {
#trapezio {
background-image:url('../img/trapezio.png');
width: 350px;
height:100px;
position:absolute;
left: 550px;
}
.nav input[type=search] {
height: 2em;
margin-left: 9.5em;
}
#bemvinda a {
margin-left:10em;
}
}
</style>
</head>
<body>
<header>
<!-- Fixed navbar -->
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<span id="trapezio"></span>
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#"><img src="logo.png" alt="SENAI BLUMENAU"/></a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>Slogan</li>
<li><input type="search" placeholder="pesquise um jogo"/></li>
<li id="bemvinda"><a href="#contact">Bem vinda, Beatriz</a></li>
</div><!--/.nav-collapse -->
</div>
</nav>
</header>
</body>
</html>
Thanks for the suggestions, Renan! Look, on the site, I’m using the Bootstrap, the part of the trapeze I’m doing by myself. Let’s say that when the screen decreases, I give a "display: None" on the trapeze (I’m using media queries for this), then in the menu there is only the logo and a button, when clicked shows a dropdown menu that has the search input.
– DaianeAlícia
Even better. Put html and CSS code related to the menu in the question.
– Renan Gomes