I have a video playing in the background of a div, however rather than showing behind the text the video is showing as a seperate section above the headline/signup form.
Live example: http://185.123.96.102/~kidsdrum/moneynest.co.uk/
I'd like the text and email signup form to show on top of the video.
Please note I'm using Bootstrap for a responsive design (video hidden on tablets/mobiles).
I'd like a video to play in the background of my jumbotron.
With full width and a height of 100% of the browser window (more content below when scrolled), this worked for an image but is having issues now.
CSS
.jumbotron {
color: white;
position:relative;
overflow:hidden;
height:500px
}
html,body {height:100%;}
.special,.special .jumbotron
{height:100%;
width: 100%;
margin: 0px;
padding: 0px;
border-radius: 0px;
}
.fullscreen-bg {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow: hidden;
z-index: -100;
}
.fullscreen-bg__video {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
#media (min-aspect-ratio: 16/9) {
.fullscreen-bg__video {
height: 300%;
top: -100%;
}
}
#media (max-aspect-ratio: 16/9) {
.fullscreen-bg__video {
width: 300%;
left: -100%;
}
}
#media (max-width: 767px) {
.fullscreen-bg {
background: url('../img/videoframe.jpg') center center / cover no-repeat;
}
.fullscreen-bg__video {
display: none;
}
}
HTML
<div class="jumbotron">
<div class="fullscreen-bg"></div>
<div class="container special">
<video loop muted autoplay poster="img/videoframe.jpg" class="fullscreen-bg__video">
<source src="http://185.123.96.102/~kidsdrum/moneynest.co.uk/vid/people-with-no-money-worries.mp4" type="video/mp4">
</video>
</div></div>
<div class="container text-center">
<div class="h1extrapadding hidden-xs hidden-sm"></div> <h1 class="boldme">Aged 20-30 & frustrated with money?</h1>
<div class="greenpromobox">
<div class="h2extrapadding hidden-xs hidden-sm"></div> <h2 class="boldme">Take our free <b class="jumpstarttext">Jumpstart Your Finances</b> class to<br /> quickly gain control over your finances</h2>
<!-- Begin MailChimp Signup Form -->
<div id="mc_embed_signup">
<form action="//moneynest.us11.list-manage.com/subscribe/post?u=9ccf2d2219536b32eaae3c3d1&id=299de51b4e" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div id="mc_embed_signup_scroll">
<img src="http://185.123.96.102/~kidsdrum/moneynest.co.uk/img/hand-drawn-arrow.png" id="handarrow" class="hidden-xs hidden-sm" alt="arrow"><input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="Enter your email address" required autofocus>
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_9ccf2d2219536b32eaae3c3d1_299de51b4e" tabindex="-1" value=""></div>
<div class="clear"><input type="submit" value="Start Class Now" name="subscribe" id="mc-embedded-subscribe" class="text-uppercase btn btn-primary btn-lg"></div>
</div>
</form>
</div>
<!--End mc_embed_signup-->
</div>
</div>
</div>
</div>
</div>
Add following style to Your .jumbotron
margin-bottom: -500px;
z-index: -1;
Should help You with this static setup. You can also play with margins values of this elements to layout them correctly.
Try this
.greenpromobox
{
top: 40px;
z-index: 9999999;
position: absolute;
margin-left: 20%;
}
add a class in your div (text and email signup form), I have added .emailBox for example and add the following style in that
.emailBox {
left: 50%;
margin-left: -585px;
position: absolute;
top: 0;
}
hope this will solve your issue.
Related
I have a Asp.net core project. I am trying to set background image for a specific page view, but it doesn't show any image! I was wondering if I need to modify any codes in the main style.css file.
Here's the view page
#mycontact:after {
content: '';
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
background: url("~/image/RealHome.jpg") no-repeat center;
background-size: cover;
filter: blur(50px);
z-index: -1;
}
.left {
background: url("~/image/RealHome.jpg") no-repeat center;
background-size: cover;
height: 100%;
}
<section id="contact">
<div id="mycontact" class="container">
<div class="contact-box">
<div class="left"></div>
<div class="right">
<h2>Contact Us</h2>
<form action="mailto:info#amrealestatesellfast.com" method="get" enctype="text/plain">
<input type="text" class="field" placeholder="Your Email">
<textarea placeholder="Message" class="field"></textarea>
<button id="submitbtn" type="submit" class="btn">Send</button>
</form>
</div>
</div>
</div>
</section>
the ~ notation is invalid to the browser, try to remove or use the absolute address like http://domain/path/to/the/image.jpg
Im trying to get my two images displayed right next to each other. Currently they keep going under each other. I have searched for some help, but all of it keeps the images the same. I hope some of you can understand the html and css and help me out with this one.
The images are inside each of they own form, and both images has gotten some styling so they have a hover effect.
.container {
position: relative;
width: 400px;
height: 400px;
display: inline-block;
}
.image {
width: 400px;
height: 400px;
}
.overlay {
position: absolute;
transition: all .3s ease;
opacity: 0;
background-color: #eee;
pointer-events: none;
}
.container:hover .overlay{
opacity: 1;
}
.text {
color: white;
font-family: sans-serif;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
font-size: 20px;
}
.overlayFade {
height: 100%;
width: 100%;
top: 0;
left: 0;
background-color: #39598cab;
}
.container:hover .overlayFade{
width: 100%;
}
<center>
<form action="FrontController" method="post">
<h2>Vælg hvilken tag type du ønsker</h2>
<div class="container">
<div class="overlay overlayFade">
<div class="text">
<h1>Spidst tag</h1>
Quick-byg carport med spidst tag
</div>
</div>
<input type="hidden" name="command" value="PointedRoof">
<input type="image" src="./IMAGES/spidsTag.jpg" class="image" value="Spidst Tag">
</div>
</form></center>
<center>
<form action="FrontController" method="post">
<div class="container">
<div class="overlay overlayFade">
<div class="text">
<h1>Fladt tag</h1>
Quick-byg carport med fladt tag
</div>
</div>
<input type="hidden" name="command" value="FlatRoof">
<input type="image" src="./IMAGES/fladtTag.png" class="image" value="Fladt tag">
</div>
</form>
</center>
Images are showing under each other because of the block property.
as Center tag has block property by default.
just add given below css in your stylesheet
center{display: inline-block;}
The best way to do is to use display :flex; and align-items:center to the parent.If you want to align both childs at both ends ,just use justify content :space-between
if you want to learn more about flex visit this link
https://css-tricks.com/snippets/css/a-guide-to-flexbox/
I have an input element, and a button element next to it.
I want the button to be a fixed size (its default size), and the input to fill the remaining width.
How do I do this?
This is my code:
<div style="position: fixed;
bottom: 0px;
left: 0px;
right: 0px;
background-color:white;
max-width:500px;">
<input type="text" #message style="height: 50px; float:right;" />
<button mat-fab (click)="newMessage()" color="primary">
<mat-icon>send</mat-icon>
</button>
</div>
</div>
You can simply use flex like this :
div {
display: flex;
}
input {
flex: 1; /* this will make the input to take the remaining space*/
}
<div style="position: fixed;
bottom: 0px;
left: 0px;
right: 0px;
background-color:white;
max-width:500px;">
<input type="text" style="height: 50px;" >
<button mat-fab (click)="newMessage()" color="primary">
<mat-icon>send</mat-icon>
</button>
</div>
Also no need to use float property, you can control the position using order property.
The above code shows the button in the right and below the button is in the left :
div {
display: flex;
}
input {
flex: 1; /* this will make the input to take the remaining space*/
order:1;
}
<div style="position: fixed;
bottom: 0px;
left: 0px;
right: 0px;
background-color:white;
max-width:500px;">
<input type="text" style="height: 50px;" >
<button mat-fab (click)="newMessage()" color="primary">
<mat-icon>send</mat-icon>
</button>
</div>
I'm trying to have the textarea boxes align with the photo, and whether they are looking at it from a desktop or cell phone I need the layout to adjust so the boxes don't fall apart from each other. Help please?
html
<center>
<h1>Custom Cut Sizing</h1>
<p> </p>
<p> </p>
</center>
<div class="center">
<div class="inline-div"><textarea style="resize: none;" cols="2" id="HeightCC" rows="2" class="leftbox"></textarea></div>
<div class="inline-div"><img class="img2" src="https://foamtouch.com//wp-content/themes/jshop/cuboid.png"/></div>
<div class="inline-div"><textarea style="resize: none;" cols="2" id="WidthCC" rows="2" class="rightbox"></textarea></div>
</div>
<center><textarea style="resize: none;" cols="2" id="LengthCC" rows="2"></textarea></center>
Estimated Costs (Including shipping):<p id="Estimated Costs"></p>
<button onclick="CalculateCosts()">Calculate Costs</button>
css
.center {
margin: auto;
padding: 0px 0px 0px 40px;
}
.inline-div {
display:inline-block;
height: 10px;
}
.leftbox {
position: relative;
top: 19%;
}
.rightbox {
position: relative;
top: 0%;
}
.img2{
width: 550px;
}
Thanks.
I'm new to world of forms! I had made divs and css for the exact layout I want for the forms. Is there anyway to maybe just turn that div tag into button or a text field while still using the same css rules so the layout doesn't change?
Here is some code and demo to just check what I have going on.
HTML
<div id="loginContainer">
<div id="loginForm">
<div id="login"></div>
<div id="loginUsername"></div>
<div id="loginPassword"></div>
<div id="loginSubmit"></div>
</div>
<div id="registerForm">
<div id="register"></div>
<div id="registerName"></div>
<div id="registerEmail"></div>
<div id="registerPassword"></div>
<div id="registerPasswordConfirm"></div>
<div id="registerSubmit"></div>
</div>
</div>
CSS
#loginContainer {
width: 50%;
height: 50%;
position: absolute;
left: 21.8%;
top: 40%;
z-index:-9999;
}
#loginForm {
width:47.5%;
height: 100%;
float:left;
top: 0%;
position:relative;
}
#login {
width: 100%;
height: 10%;
top: 0;
background-image:url(../_images/_login/login.png);
background-size: 100% 100%;
position: absolute;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
}
#loginUsername {
width: 100%;
height: 10%;
top: 15%;
background-color: #383d3f;
position: absolute;
border-radius: 5px;
}
#loginPassword {
width: 100%;
height: 10%;
top:30%;
background-color:#383d3f;
position:absolute;
border-radius: 5px;
}
#loginSubmit {
width: 100%;
height: 10%;
top: 45%;
background-color:#76c2bb;
position:absolute;
border-radius: 5px;
}
#registerForm {
width:47.5%;
height: 100%;
float:right;
top: 0%;
position:relative;
}
#register {
width: 100%;
height: 10%;
top:0%;
background-image:url(../_images/_register/register.png);
background-size: 100% 100%;
position:absolute;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
}
#registerName {
width: 100%;
height: 10%;
top:15%;
background-color:#383d3f;
position:absolute;
border-radius: 5px;
}
#registerEmail {
width: 100%;
height: 10%;
top: 30%;
background-color:#383d3f;
position:absolute;
border-radius: 5px;
}
#registerPassword {
width: 100%;
height: 10%;
top: 45%;
background-color:#383d3f;
position:absolute;
border-radius: 5px;
}
#registerPasswordConfirm {
width: 100%;
height: 10%;
top: 60%;
background-color:#383d3f;
position:absolute;
border-radius: 5px;
}
#registerSubmit {
width: 100%;
height: 10%;
top: 75%;
background-color:#76c2bb;
position:absolute;
border-radius: 5px;
}
CLICK FOR DEMO
Sure you can, just replace the right elements with input with proper markup, add an opening and closing form tag, remove the borders, and you're good to go:
<div id="loginContainer">
<div id="loginForm">
<div id="login"></div>
<form method="post" name="loginForm">
<input id="loginUsername" type="text" name="loginUsername" />
<input id="loginPassword" type="text" name="loginPassword" />
<input id="loginSubmit" type="submit" name="loginSubmit" value="" />
</form>
</div>
<div id="registerForm">
<div id="register"></div>
<form method="post" name="loginForm">
<input id="registerName" type="text" name="registerName" />
<input id="registerEmail" type="text" name="registerEmail" />
<input id="registerPassword" type="text" name="registerPassword" />
<input id="registerPasswordConfirm" type="text" name="registerPasswordConfirm" />
<input id="registerSubmit" type="submit" name="registerSubmit" value="" />
</form>
</div>
</div>
#loginContainer input {
border:0
}
Here is your updated demo: http://jsfiddle.net/7w1adgko/2/
EDIT: Note that you may want to fill out the value property of the submit buttons so that users will actually know it's the submit button.
<input id="loginSubmit" type="submit" name="loginSubmit" value="Login" />
or...
<input id="registerSubmit" type="submit" name="registerSubmit" value="Register" />
Also, in order users to know what field is what, you may want to use the placeholder property.
<input id="loginUsername" type="text" name="loginUsername" placeholder="Username" />
<input id="loginPassword" type="text" name="loginPassword" placeholder="Password" />
or...
<input id="registerName" type="text" name="registerName" placeholder="Name" />
<input id="registerEmail" type="text" name="registerEmail" placeholder="Email" />
<input id="registerPassword" type="text" name="registerPassword" placeholder="Password" />
<input id="registerPasswordConfirm" type="text" name="registerPasswordConfirm" placeholder="Confirm Password" />
And to make it prettier, you could add some colour and padding to the inputs.
#loginContainer input {
border:0;
padding: 0 10px;
color:white
}
Here is your most recent fiddle with these changes: http://jsfiddle.net/7w1adgko/3/
EDIT 2: To make all the boxes have the same width, you could specify the same box model for type="text" and type="submit" inputs (source: CSS: Submit button looks smaller than text input and textarea)
#loginContainer input {
border:0;
padding: 0 10px;
color:white;
box-sizing: border-box;
-moz-box-sizing: border-box;
}
Here is the updated fiddle: http://jsfiddle.net/7w1adgko/4/
It would be better to start from the proper functional markup and then consider styling. For the functionality of a form, you need elements like input to set up the controls, label to have labels (captions) associated with controls, and form to contain the entire form. (And you probably should not have two forms side by side, it can be confusing.)
However, if you have designed a layout in a “DIVistic” way and you wish to turn it to a functional form element with working controls, you need to take into account that form-related elements have default rendering that you may need to override. A form element has top and bottom margin by default, label elements are inline elements (display: inline) as opposite to div elements that are blocks (display: block), and input elements are inline blocks that have borders and padding.
On the other hand, most (if not all) of your div elements are just containers, instead of being direct counterparts to controls. For example, the element <div id="loginUsername"></div> really needs some content, such as
<div id="loginUsername"><label for="uname">User name:</label>
<input id="uname" name="uname" required size="8" maxlength="8"></div>
Assuming that the content fits inside the div element as formatted in your current design, no change in the layout styling is then needed. (However, from the jsfiddle, it seems that you intend to use form controls without any labels. This would be a major usability and accessibility problem, and fixing it probably requires a redesign of the layout.)