How do I change the size of the Header Menu DIV using CSS? - menu

What code do I add/ replace/ remove to change the size ofmarketbot.net

Are you talking about the global navigation menu or the slider that is on the page? The slider looks like it has a margin problem (in both I.E. 8 and Google Chrome).
I adjusted the css class named content-top to the following, so it isn't overflowing into the header:
.content-top
{
position:relative;
margin-top: 80px;
margin-bottom: 5px;
}
After I made the adjustments, it looks somewhat cleaner in the slider and header divs.

#header {
background: #FFFFFF
width: 100%;
padding: 30px 0px;
position:relative;
margin-top: 80px;
margin-bottom: 5px;
}
i didn't completely understand your question but i have tried to answer it.
you would need to edit
#header {
background: #FFFFFF
width: 100%;
padding: 20px 0px;
}

Related

I can't remove the white background color of the menu

I've been trying to solve this problem all day without success.
I want to change de background color from my home page. For this i have use this CSS:
.page-id-6128 {
background-color: #F5F5DC;
background-size: cover;
padding-top: 0px;
padding-bottom: 0px;
margin-bottom: 0px;
min-height: 100vh;
background-position: 50% 100%;
}
The problem is that i can't remove the white background from the menu as you can see in the next image:
https://i.stack.imgur.com/C9c2P.png
www.albertosotophotography.com/home
Thank you for your help!
Add this:
.navbar {
background-color: #F5F5DC;
}
EDIT
Better solution - remove background-color property from your .site class. Now you have:
.site {
background-color: #fff;
margin: 0 auto;
width: 100%;
}

Center display-inblock

On (my site) I would like to place the menubar in the center of the page.
Here the code of my menubar:
#navigation {
padding-bottom: auto;
width: 960px;
margin: auto;
text-align: center;
text-transform: uppercase;
overflow: hidden;
font-family: 'Raleway', sans-serif;
font-size: 13px;
background-color: #DDDDDD;
border: 0px solid;
border-radius: 15px;
color: #000000;
display: inline-block;
}
Thanks in advance for helping me! :)
Add width: 100%; to your #navigation for a full-wdith centered menu.
Or change the display to block for a centered menu without a full-width background.
If you want to keep the yellow line under, add a 1px bottom margin. This will shift the rest one pixel lower and it will reveal a yellow line.
margin-bottom: 1px
Working JSFiddle for this: http://jsfiddle.net/qwnwkp7u/2/
Switch display: inline-block; to display: block;
I guess you need to understand something about block and inline-block elements.
Block elements , if sized and smaller than page/container can basicly; be centered with margin:auto;.
Inline-block element behaves like text and can follow text-align value.
To center your menu , you have then 2 options:
margin:auto; with a block formating, you need then just to remove your inline-block display wich does:
#navigation {
padding-bottom: auto;
width: 960px;
margin: auto;
text-align: center;
text-transform: uppercase;
overflow: hidden;
font-family: 'Raleway', sans-serif;
font-size: 13px;
background-color: #DDDDDD;
border: 0px solid;
border-radius: 15px;
color: #000000;
}
or
text-align:center; from its parent if as an inline boxe. Wich would be here :
.bg-wrapper {
text-align:center;
}
If inline-block was here used to trigger some special layout , like to hold floatting elements, you could here turn display:block into display:table;.
doei

Centering fluid div having max-width

I'm trying to center my content div. It's set to 100%, and the div is contained in body, which is also set to 100%. I have a max-width: 1400px because I don't want my content to stretch more than that if the screen resolution is higher. The thing is, it doesn't work using margin: auto. My content stands on the left, uncentered on screen wider than 1400px.
If I delete the max-width, everything is perfectly centered on wide screens, but the content is stretched to the the whole screen...
#content {
width: 100%;
height: auto;
position: absolute;
top: 400px;
margin: 0 auto;
margin-top: 50px;
display: none;
max-width: 1400px;
}
Easiest way to achieve this, is to set the width property to the max width you need, and add max-width: 100%;. This will prevent it from being bigger than 100% but still go up to the max width. Also, you should remove the absolute positioning:
JS Fiddle
You can use the transform technique, which doesn't require extra mark-up or media queries.
#content {
position: relative; /* 'fixed' will work also. */
max-width: 500px; /* Your required width here. */
width: 100%;
left: 50%;
transform: translateX(-50%);
}
Here's a demo https://jsfiddle.net/matharden/6uduf7av/
Use Flexbox...
Put this classes in the parent element (the body):
The HTML
<body class="p-flexbox flex-hcc">
<!-- The content -->
</body>
Where:
p-flexbox means parent-flexbox
flex-hcc means flexbox-horizontal-center-center
The CSS
.p-flexbox {
display: -webkit-box;
display: -moz-box;
display: box;
}
.flex-hcc {
-webkit-box-orient: horizontal;
-webkit-box-pack: center;
-webkit-box-align: center;
-moz-box-orient: horizontal;
-moz-box-pack: center;
-moz-box-align: center;
box-orient: horizontal;
box-pack: center;
box-align: center;
}
Cheers,
Leonardo

inline-block with empty content makes layout disordered (vertical alignment)?

I'm working some css and encountered a weird problem. Two elements are inline-block staying in the same container. Both of them have the width, height, and line-height.
But if we set the first element an empty content, the layout will be disordered (vertical alignment).
You can see the problem here
<div class="part">
<div class="foo"></div>
<div class="bar">bar</div>
</div>
.part {
width: 400px;
height: 80px;
background-color: #ddd;
margin-bottom: 100px;
}
.foo {
display: inline-block;
width: 100px;
height: 80px;
line-height: 80px;
background-color: red;
}
.bar {
display: inline-block;
width: 100px;
line-height: 80px;
height: 80px;
background-color: green;
}
I know empty content is always a bad smell of html code. But I just want to know why this is and how to solve this problem.
I found a similar question. People say we could use a &nbsp instead of empty content. Is this the only way we could solve it? Or we have other better solution?
Thanks.
use 'vertical-align: middle;' to the inline-block element
vertical-align: middle;
http://jsbin.com/ajexab/1/edit

How to make vertical menu with emenu extension in Yii?

Using the emenu Yii extension for a menu. The underlying project for this extension is http://lwis.net/free-css-drop-down-menu/ .
Right now the sub menus display in a row (which does eventually wrap to a 2nd row). I'm using the "nvidia" theme.
How do I make submenus vertical? I want the items in the sub menu to stack vertically on top of one another.
This is a css issue. The inner <ul> should have the style: width : 100% which comes from dropdown.css, but it is being overridden by themes/nvidia.com/default.css where it is specified as: width: 170px. So you can change that value back to 100% by adding it in your own custom css file.
dropdown.css:
ul.dropdown ul {
visibility: hidden;
position: absolute;
top: 100%;
left: 0;
z-index: 598;
width: 100%;
}
themes/nvidia.com/default.css:
ul.dropdown ul {
width: 170px;
background-color: #333;
color: #fff;
font-size: 11px;
text-transform: none;
filter: alpha(opacity=90);
-moz-opacity: .9;
KhtmlOpacity: .9;
opacity: .9;
}
mystyle.css:
ul.dropdown ul{
width:100% !important;
}

Resources