transparent menu / css - html

I am working on a transparent menu for my site.This is my current code
nav{
display: inline-block;
position:overlay;
top:0;
left:0;
width:100%;
height:80px;
padding: 10px 90px;
box-sizing: border-box;
background: rgba(0,0,0,.5);
}
I want the menu to be transparent like this site
https://www.holeman-finch.com.
Thanks in advance

nav{
display: inline-block;
position:overlay;
top:0;
left:0;
width:100%;
height:80px;
padding: 10px 90px;
box-sizing: border-box;
background: rgba(0,0,0,.5);
margin-bottom:-80px
}

nav{
display: inline-block;
position: overlay;
top:0;
left:0;
width:100%;
height:80px;
padding: 10px 90px;
box-sizing: border-box;
background-color: transparent;
}

On your header element, you can use any transparent background color, for example a very light white transparent shade which will work fine as an overlay on a darker photo:
background-color: #ffffff42;
In order for your header to actually float on top of the photo behind it, add position: fixed; or position: sticky; to it, for example. The same effect can also be achieved with position: absolute; and some extra top, right and left properties.

nav {
max-width: 960px;
/* The mask-image gives us some extra fading. It is not necessary but without this, you can't face out the box-shadows. This clips our menu */
mask-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, #ffffff 25%, #ffffff 75%, rgba(255, 255, 255, 0) 100%);
margin: 0 auto;
/* Using padding instead of margin for the top and bottom here will keep our box-shadow visible and not affected by the mask-image */
padding: 75px 0;
}
nav ul {
text-align: center;
background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.2) 25%, rgba(255, 255, 255, 0.2) 75%, rgba(255, 255, 255, 0) 100%);
width: 100%;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.1), inset 0 0 1px rgba(255, 255, 255, 0.6);
}
nav ul li {
display: inline-block;
}
nav ul li a {
padding: 20px;
font-family: "Roboto";
color: rgba(0, 0, 0, 0.5);
text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.4);
font-size: 25px;
text-decoration: none;
display: block;
}

Related

CSS styling navigation bar with short vertical lines

As mentioned above I'm trying to get result like described in the title but for a better explanation here is my idea idea_prototype. I tried the basic css which has been provided here but my expectations are slightly different.
Current outcome: navigation bar
HTML code:
HTML <- sorry Stack is not letting me add this as a code
CSS code:
nav {
width: 1300px auto;
max-width: 1300px;
mask-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, #ffffff 25%, #ffffff 75%, rgba(255, 255, 255, 0) 100%);
margin: 0 auto;
padding: 60px 0;
}
nav ul {
text-align: center;
background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.2) 25%, rgba(255, 255, 255, 0.2) 75%, rgba(255, 255, 255, 0) 100%);
border-width: 3px;
border-style: solid;
border-color:white;
border-radius: 10% / 100%
}
nav ul li {
display: inline-block;
}
nav ul li a {
padding: 18px;
font-family: "Arial";
color: white;
font-size: 20px;
display: block;
}
nav ul li a:hover {
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1), inset 0 0 1px rgba(255, 255, 255, 0.6);
background: rgba(255, 255, 255, 0.1);
color: white;
}
Its very easy, you dont even need that div with class vl, my thinking is that you put that div for the vertical line on the right, but there is no need of that, you can make that line with css property border-right
nav ul {
list-style:none;
display: flex;
padding: 10px 15px;
border-radius: 10px;
border: 1px solid #333;
}
nav ul li {width: 100%;text-align: center; }
nav ul li:not(:last-child){border-right: 1px solid #888;}
nav ul li a {text-decoration: none; color: #333;}
<nav>
<ul>
<li>
About
</li>
<li>
experience
</li>
<li>
Skills
</li>
<li>
Plans
</li>
<li>
Portafolio
</li>
<li>
Contact
</li>
</ul>
</nav>

Prevent gradient overlay from scrolling

I am trying to put a small gradient on the bottom of a scrolling div. I've based my solution on the accepted answer to this SO thread. The gradient shows up fine, but when I scroll the content in the div, the bottom of the gradient moves. I need it to remain in place so that the content scrolls independently of the gradient. I've tried several combinations of position: fixed, position: relative, and position: relatve to no avail. What have I missed?
Relevant markup:
<div class="resultListContainer">
<ul class="result">
<li><span class="resultPermitNumber resultElement">B123456789</span></li>
<li><span class="resultPermitType resultElement">FINAL</span></li>
<li><span class="resultDisplayAddress resultElement">41975 LOUDOUN CENTER PL SE, LEESBURG, VA 20175</span></li>
</ul>
<!-- Lots more of the ul. -->
</div>
Relevant CSS:
.resultListContainer {
border: 1px solid #000;
height: 400px;
width: 40em;
overflow-y: scroll;
font-size: 1em;
position: relative;
}
.resultListContainer::before {
background-image: linear-gradient( top, rgba( 255, 255, 255, 0 ) 0%, rgba( 255, 255, 255, 1 ) 100% );
background-image: -moz-linear-gradient( top, rgba( 255, 255, 255, 0 ) 0%, rgba( 255, 255, 255, 1 ) 100% );
background-image: -ms-linear-gradient( top, rgba( 255, 255, 255, 0 ) 0%, rgba( 255, 255, 255, 1 ) 100% );
background-image: -o-linear-gradient( top, rgba( 255, 255, 255, 0 ) 0%, rgba( 255, 255, 255, 1 ) 100% );
background-image: -webkit-linear-gradient( top, rgba( 255, 255, 255, 0 ) 95%, rgba( 255, 255, 255, 1 ) 100% );
content: "\00a0";
height: 100%;
position: absolute;
width: 100%;
}
.result {
margin-bottom: 0;
padding-top: 5px;
padding-bottom: 5px;
padding-left: 5px;
list-style-type: none;
}
The result:
Because your element is positioned absolute, it's position is absolute to the parent element so when you scroll it scrolls with your content. What you want is your ul to scroll. I have quickly rewritten yours, but below I've got a simplified and cleaned up version:
.resultListContainer {
border: 1px solid #000;
height: 400px;
width: 40em;
font-size: 1em;
position: relative;
}
.resultListContainer::before {
background-image: linear-gradient( top, rgba( 255, 255, 255, 0 ) 0%, rgba( 255, 255, 255, 1 ) 100% );
background-image: -moz-linear-gradient( top, rgba( 255, 255, 255, 0 ) 0%, rgba( 255, 255, 255, 1 ) 100% );
background-image: -ms-linear-gradient( top, rgba( 255, 255, 255, 0 ) 0%, rgba( 255, 255, 255, 1 ) 100% );
background-image: -o-linear-gradient( top, rgba( 255, 255, 255, 0 ) 0%, rgba( 255, 255, 255, 1 ) 100% );
background-image: -webkit-linear-gradient( top, rgba( 255, 255, 255, 0 ) 95%, rgba( 255, 255, 255, 1 ) 100% );
content: "\00a0";
height: 100%;
position: absolute;
width: 100%;
z-index: 2;
pointer-events: none;
}
.result {
position: absolute;
left: 0;
top: 0;
margin: 0;
box-sizing: border-box;
z-index: 1;
width: 100%;
height: 100%;
margin-bottom: 0;
padding-top: 5px;
padding-bottom: 5px;
padding-left: 5px;
list-style-type: none;
overflow-y: scroll;
}
.result li {
height: 100px;
background: red;
}
<div class="resultListContainer">
<ul class="result">
<li><span class="resultPermitNumber resultElement">B123456789</span></li>
<li><span class="resultPermitType resultElement">FINAL</span></li>
<li><span class="resultDisplayAddress resultElement">41975 LOUDOUN CENTER PL SE, LEESBURG, VA 20175</span></li>
<li><span class="resultPermitNumber resultElement">B123456789</span></li>
<li><span class="resultPermitType resultElement">FINAL</span></li>
<li><span class="resultDisplayAddress resultElement">41975 LOUDOUN CENTER PL SE, LEESBURG, VA 20175</span></li>
<li><span class="resultPermitNumber resultElement">B123456789</span></li>
<li><span class="resultPermitType resultElement">FINAL</span></li>
<li><span class="resultDisplayAddress resultElement">41975 LOUDOUN CENTER PL SE, LEESBURG, VA 20175</span></li>
</ul>
<!-- Lots more of the ul. -->
</div>
Basically there are two things that are important: your outer box cannot be scrollable, you inner box can. All the fixed elements need to be outside your inner box (which is your ul in this case). Secondly, your :before cannot be 100% high, as it will absorb your mouse events, preventing scrolling. For all browsers except IE you can solve this by using pointer-events: none, but otherwise the safest way is to make your gradient a fixed height and your :before element the height of the gradient you want, resulting in a (in this case) 20px area that would not take your mouse events at the bottom.
html, body { height: 100%; } body { padding: 0; margin: 0; }
div {
width: 400px;
height: 400px;
max-height: 100%;
position: relative;
}
div:before, div ul {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
}
div:before {
background: linear-gradient(0deg, rgba(255,255,255,1), rgba(255,255,255,0));
background-size: 100% 100%;
height: 20px;
z-index: 2;
/* IE does not support pointer events, so making this small in height is important
as your scroll events will not be passed to the ul if it is covered by your :before */
pointer-events: none;
content: '';
display: block;
}
div ul {
margin: 0;
padding: 0;
height: 100%;
overflow-y: scroll;
z-index: 1;
}
div li {
width: 100%;
height: 100px;
background: #ececec;
}
div li:nth-child(2n){
background: #cecece;
}
<div>
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
</ul>
</div>
You need to wrap your container in another div that is positioned as relative.
Also, overlay will block your scroll bar, so instead of width: 100% I used: left:0; right: 16px; - now scroll is clickable.
Try my fiddle:
https://fiddle.jshell.net/8c6k4k6d/1/
replace
.resultListContainer::before
with
.resultListContainer .result:last-of-type::before

how can i know what is the website page made off?

Can you help me to analyze the elements of this website ?
www.hardrock.com
I want to make it similar to this.
How i can do that ? for example, the menu how i do it move when the user scrolling down ?
this is the navigation CSS code:
html, body {
height: 100%;
}
body {
background: linear-gradient( #CCCCCC, #CCCCCC 0%, #999999 25%, #666666 50%, #999999 75%, #CCCCCC 100%);
}
nav {
max-width: 960px;
/* The mask-image gives us some extra fading. It is not necessary but without this, you can't face out the box-shadows. This clips our menu */
mask-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, #ffffff 25%, #ffffff 75%, rgba(255, 255, 255, 0) 100%);
margin: 0 auto;
/* Using padding instead of margin for the top and bottom here will keep our box-shadow visible and not affected by the mask-image */
padding: 75px 0;
}
nav ul {
text-align: center;
background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.2) 25%, rgba(255, 255, 255, 0.2) 75%, rgba(255, 255, 255, 0) 100%);
width: 100%;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.1), inset 0 0 1px rgba(255, 255, 255, 0.6);
}
nav ul li {
display: inline-block;
}
nav ul li a {
padding: 20px;
font-family: "Roboto";
color: rgba(0, 0, 0, 0.5);
text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.4);
font-size: 25px;
text-decoration: none;
display: block;
}
nav ul li a:hover {
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1), inset 0 0 1px rgba(255, 255, 255, 0.6);
background: rgba(255, 255, 255, 0.1);
color: rgba(0, 0, 0, 0.7);
}
/* Demo credits stuff */
#import url(http://fonts.googleapis.com/css?family=Nixie+One);
h1#author {
position: fixed;
bottom: 50px;
text-align: center;
color: #30303f;
width: 100%;
background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.2) 25%, rgba(255, 255, 255, 0.2) 75%, rgba(255, 255, 255, 0) 100%);
padding: 10px 0;
font-family: "Nixie One";
text-stroke: 1px;
font-size: 30px;
text-shadow: 0 0 10px #aaaaaa;
font-family: "Roboto"
}
h1#author a {
color: #3399dd;
text-decoration: none;
}
I wouldn't just copy and paste code from someone elses work. With that said, there's probably JavaScript involved somewhere.
I would just save the web page to your desktop and take it from there. Taking bits away until you have just what you need
you can know this with help of browser Extensions , search in browser's extensions "wappalyzer"
or you can visit this site for more information wappalyzer

Fixed div over absolute?

I want to create similiar page to this. Especially I am interesed in that image with a flag. I tried to make something similiar to that and this is what I already managed to do: Fiddle.
Html:
<div id="logo"> <img src="http://s20.postimg.org/9sr84gnw9/logo.png" alt="logo"></img>
<ul id="navbar">
<li>Maršrutai
</li>
<li>Nuotraukos
</li>
<li>Apie mane
</li>
<li>Dviračiai
</li>
<li>Kontaktai
</li>
</ul>
<div id="header">
<h1>MARŠRUTAI</h1>
</div>
<div id="content"></div>
CSS:
body {
background: radial-gradient(black 15%, transparent 16%) 0 0, radial-gradient(black 15%, transparent 16%) 8px 8px, radial-gradient(rgba(255, 255, 255, .1) 15%, transparent 20%) 0 1px, radial-gradient(rgba(255, 255, 255, .1) 15%, transparent 20%) 8px 9px;
background-color: #282828;
background-size: 16px 16px;
}
#header {
background-image:url(http://s20.postimg.org/gcpvgfth8/header.jpg);
position: fixed;
width: 100%;
height:150px;
text-align:center;
text-top:50%;
color: white;
top:70px;
left:0;
text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
padding: 50px 0;
}
#content {
width:100%;
height:100%;
position: absolute;
top:351px;
/*bacground gradients: http://lea.verou.me/css3patterns/# */
background: radial-gradient(black 15%, transparent 16%) 0 0, radial-gradient(black 15%, transparent 16%) 8px 8px, radial-gradient(rgba(255, 255, 255, .1) 15%, transparent 20%) 0 1px, radial-gradient(rgba(255, 255, 255, .1) 15%, transparent 20%) 8px 9px;
background-color: #282828;
background-size: 16px 16px;
left:0;
bottom:0;
}
#logo {
position:fixed;
}
ul {
text-shadow: 0px 2px #444;
font-size: 20px;
padding: 0;
list-style: none;
text-align: center;
display: table;
margin: 0 auto;
position: fixed;
left: 32%;
right: 25%;
top:15px;
}
ul li {
position: relative;
margin: 0;
padding: 0;
display: inline-block;
}
li ul {
display: none;
}
ul li a {
display: inline-block;
text-decoration: none;
color: #eee;
padding: 5px 0;
white-space: nowrap;
margin: 5px;
vertical-align: middle;
text-align: center;
border: 1px solid transparent;
}
ul li a:hover {
border-width: 1px;
border-style: solid;
border-color: #FFFFFF;
-moz-border-radius: 5px;
border-radius: 5px;
color: #CACACA;
As you can see, when you scrool down, content div with pisition:absolute, covers all other divs with position:fixed. But I want that when you scrool down, content div would cover just header div and logo and ul would stay on top of everything. Just like in this page.
I'm not sure that I'm doing it right because I'm newbie at creating html. Is there any other way to make something like that?
Just use an higher z-index on your logo and nav and it will work as you wish.

Align CSS3 button inside wrapper using html

I have a simple css3 button and I need to align this button inside my wrapper as shown.
If I use the below code I am able to do but whenever I resize my browser it is not fixed in its place and its moving along with the browser.
This is my wrapper code:
.Wrapper
{
position: absolute;
left: 38%;
width: 914px;
height:584px;
margin-top: 50px;
margin-left: -266px;
padding: 15px;
border: 1px solid #99CCFF;
background-color: #FFFFFF;
}
Here is my CSS3 button code:
.button, .button span {
display: inline-block;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.button {
white-space: nowrap;
line-height:1em;
position:absolute;
top:443px;
left:1030px;
outline: none;
overflow: visible; /* removes extra side padding in IE */
cursor: pointer;
border: 1px solid #999;/* IE */
border: rgba(0, 0, 0, .2) 1px solid;/* Saf4+, Chrome, FF3.6 */
border-bottom:rgba(0, 0, 0, .4) 1px solid;
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2);
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.2);
box-shadow: 0 1px 2px rgba(0,0,0,.2);
background: -moz-linear-gradient(
center top,
rgba(255, 255, 255, .1) 0%,
rgba(0, 0, 0, .1) 100%
);/* FF3.6 */
background: -webkit-gradient(
linear,
center bottom,
center top,
from(rgba(0, 0, 0, .1)),
to(rgba(255, 255, 255, .1))
);/* Saf4+, Chrome */
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#19FFFFFF', EndColorStr='#19000000'); /* IE6,IE7 */
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#19FFFFFF', EndColorStr='#19000000')"; /* IE8 */
-moz-user-select: none;
-webkit-user-select:none;
-khtml-user-select: none;
user-select: none;
margin-bottom:10px;
}
.button.full, .button.full span {
display: block;
}
.button:hover, .button.hover {
background: -moz-linear-gradient(
center top,
rgba(255, 255, 255, .2) 0%,
rgba(255, 255, 255, .1) 100%
);/* FF3.6 */
background: -webkit-gradient(
linear,
center bottom,
center top,
from(rgba(255, 255, 255, .1)),
to(rgba(255, 255, 255, .2))
);/* Saf4+, Chrome */
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#33FFFFFF', EndColorStr='#19FFFFFF'); /* IE6,IE7 */
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#33FFFFFF', EndColorStr='#19FFFFFF')"; /* IE8 */
}
.button:active, .button.active {
top:1px;
}
.button span {
position: relative;
color:#fff;
text-shadow:0 1px 1px rgba(0, 0, 0, 0.25);
border-top: rgba(255, 255, 255, .2) 1px solid;
padding:0.8em 1.9em;
line-height:1em;
text-decoration:none;
text-align:center;
white-space: nowrap;
}
.button.large span {
font-size:22px;
}
.button.blue {
background-color: #3a80e2;
width:229px;
height:58px;
}
This is how I'm showing it:
<div class="Wrapper">
<a class="button large blue" href="#"><span>Sample Button</span></a>
<div>
This is before resizing:
This is while resizing:
Here is a js fiddle demo
You have these lines in your .button class:
position:absolute;
top:443px;
left:1030px;
Change them to your needs. For example:
position:relative;
margin:40px auto;
I hope that helps
UPDATE: Is this what you want? http://jsfiddle.net/kGs6f/3/show/