HTML Section :
<div id='wrapper'>
<div id='box'>
Name:<br>
<input type='text' id='name' size='10'><br><br>
Message:<br>
<textarea id='message' size='15' ></textarea><br><br>
<br>
<div id='Send'> Send</div>
</div>
<div class='messages'>
<div id='loader'></div>
<ul class='update'></ul>
<?php //include(messages.php) ?>
</div>
</div>
CSS Section:
#box{
width:300px;
height: 230px;
border:solid #6895CC 1px;
-webkit-box-shadow: 0 2px 5px #666;
box-shadow: 0 2px 5px #666;
padding: 10px;
margin:50px 0 0 400px;
}
#name{
width:300px;
height: auto;
border:solid #6895CC 1px;
padding: 10px;
margin:5px 5px 0 2px;
border-radius: 5px;
}
#message{
width:300px;
height: auto;
border:solid #6895CC 1px;
padding: 10px;
margin:5px 5px 0 2px;
border-radius: 5px;
}
#send{
width: 50px;
border-radius: 5px;
padding: 5px;
background-color:#6895CC;
border:none;
color:#fff;
}
#send:hover{
background-color:#4E65C0;
}
body{
font-family:Verdana, Geneva, sans-serif;
font-size:11px;
}
.messages{
display:inline;
width:250px;
height:638px;
overflow:hidden;
border:solid #8CACDD;
font-family:Arial, Helvetica, sans-serif;
font-size:11px;
float:right;
border-width:0 0 1px 1px;
}
How do i move the messages column up on the right ? I have already included the inline element which removes any next line character before and after. what needs to be done to get it up ?
try giving float:left to CSS #box.
#box {
border: 1px solid #6895CC;
box-shadow: 0 2px 5px #666666;
float: left;
height: 230px;
margin: 50px 0 0 400px;
padding: 10px;
width: 300px;
}
I'm not really sure where exactly you imagine to be "up on the right".
I guessed you mean up on the right side within the form.
To do that you have to give your form elements a wrapper div, like:
<div id='Form'>
<div id='box'>
Name:<br>
<input type='text' id='name' size='10'><br><br>
Message:<br>
<textarea id='message' size='15' ></textarea><br><br>
<br>
<div id='Send'> Send</div>
</div>
<div class='messages'>
<div id='loader'>test</div>
<ul class='update'></ul>
<?php //include(messages.php) ?>
</div>
</div>
and give the wrapper #Form element position: relative; and the .messages:
position: absolute;
top: 0;
right: 0;
look here if it what you want: FIDDLE
Related
I have an HTML page with embedded CSS styling. It has a form with an input button that says "Submit Payment" using #fjButton and height of 54, which gets obeyed. I also have an that has an id #fjButton2 with a height of 14... both set to !important. The #fjButton2 doesn't get obeyed. Im's sure it's some stupid thing, but i just can't figure it out... the stays at 32px no matter what i do. See it at:
https://codepen.io/johnstonf/full/YzwGqNO
<!DOCTYPE html>
<html>
<head>
<title>Test-Store</title>
<link href="https://fonts.googleapis.com/css?family=Fjalla+One|Inter&display=swap" rel="stylesheet">
<!-- Landing page styling -->
<style type="text/css">
body{
background-color: #f2f4f9;
}
h3, h5{
font-family: 'Fjalla One', sans-serif;
font-weight: 100;
}
h3{
font-size: 36px;
}
h5{
font-size: 24px;
}
p, label{
font-family: 'Inter', sans-serif;
}
hr{
color:#fff;
background-color: #fff;
border-top:1px solid #fff;
margin-top:10px;
margin-bottom: 10px;
}
#container{
width:1200px;
margin:0 auto;
padding-top: 3%;
}
.column-6{
text-align: center;
width: 50%;
float:left;
}
#left-wrapper{
background-color: #72cca7;
box-shadow: 0 1px 3px 0 #dce0e6;
border-radius: 14px;
border: 3px solid black;
margin-right: 14px;
margin-top: 14px;
padding: 13px;
}
#right-wrapper{
padding-top: 13px;
margin-top: 13px;
border-radius: 14px;
border: 3px solid black;
margin-right: 14px;
background-color: #72cca7;
box-shadow: 0 1px 3px 0 #dce0e6;
border-radius: 14px;
border: 3px solid black;
margin-right: 14px;
margin-top: 14px;
padding: 13px;
}
#profile-pic{
width:200px;
display:block;
margin: 0 auto;
border-radius: 50%;
float:left;
}
#left-wrapper-header{
min-width:50%;
float:left;
padding-left:20px;
}
#left-wrapper-header h3{
color:#fff;
}
#right-wrapper h3{
color: #10a195;
}
.Z9999{
margin-left: 1px;
width: 99%;
}
/* ------------------------ FORM FIELDS ------------------------ */
.form-field-12{
width: 100%;
margin-bottom: 6px;
padding-top: 3px;
}
.form-field-6{
width: 50%;
float:left;
margin-bottom: 1px;
}
select{
width: 100%;
height: 25px!important;
box-shadow: 0 1px 3px 0 #dce0e6;
padding: 1px 2px;
border-radius: 4px;
background-color: #fff;
border: 1px solid transparent;
font-size: 20px;
color: #44464a;
}
input{
box-shadow: 0 1px 3px 0 #dce0e6;
height:40px;
border-radius: 4px;
background-color: #fff;
border: 1px solid transparent;
color: #44464a;
width: 95%;
padding: 5px;
font-size: 16px;
}
input::placeholder {
color: #9fa1a6;
}
/* ------------------------ BUTTON STYLING ------------------------ */
#fjButton {
box-shadow: 0 1px 3px 0 #dce0e6;
font-family:'Fjalla One', sans-serif;;
border-radius: 4px;
background-color: #fff;
border: 1px solid transparent;
color: #44464a;
height: 54px !important;
width: 30%;
padding: 5px;
font-size: 16px;
text-decoration:none;
margin: 0px;
}
#fjButton2 {
box-shadow: 0 1px 3px 0 #dce0e6;
font-family:'Fjalla One', sans-serif;;
border-radius: 4px;
background-color: #fff;
border: 1px solid transparent;
color: #44464a;
height: 14px !important;
width: 30%;
padding: 5px;
font-size: 16px;
text-decoration:none;
margin: 0px;
}
.myButton:hover {
opacity: .6;
}
#media screen and (max-width:1200px){
#container{
width:80%;
}
.column-6{
width: 100%;
}
}
#media screen and (max-width:800px){
#container{
width:100%;
}
.Z9999{
margin-left: 20px;
width: 100px;
}
}
</style>
<!-- Success page styling -->
<style type="text/css">
h4{
font-family: 'Fjalla One', sans-serif;
font-weight: 100;
font-size: 24px;
}
#box{
max-width: 500px;
margin:0 auto;
margin-top: 100px;
padding:30px;
background-color: #fff;
text-align: center;
box-shadow: 0 1px 3px 0 #dce0e6;
border-radius: 4px;
border: 1px solid transparent;
}
.myButton {
background-color:#72cca7;
background-color:#26367e;
display:inline-block;
cursor:pointer;
color:#ffffff;
font-family:Verdana;
font-size:17px;
padding:10px;
width:30%;
border-radius: 0;
text-decoration:none;
text-align: center;
transition: .3s;
}
.myButton:hover {
opacity: .6;
}
#succes-icon{
width: 100px;
}
</style>
</head>
<body>
<style type="text/css">
.StripeElement {
box-sizing: border-box;
height: 40px;
padding: 10px 12px;
border: 1px solid transparent;
border-radius: 4px;
background-color: white;
box-shadow: 0 1px 3px 0 #e6ebf1;
-webkit-transition: box-shadow 150ms ease;
transition: box-shadow 150ms ease;
}
.StripeElement--focus {
box-shadow: 0 1px 3px 0 #cfd7df;
}
.StripeElement--invalid {
border-color: #fa755a;
}
.StripeElement--webkit-autofill {
background-color: #fefde5 !important;
}
</style>
<script src="https://js.stripe.com/v3/"></script>
<div id="container">
<div class="column-6">
<div id="left-wrapper">
<img id="profile-pic" src="{% static 'images/logo-20may29.png' %}">
<div id="left-wrapper-header">
<h3>Item Purchase</h3>
</div>
<div style="clear:left"></div>
<hr>
<!-- Add form here -->
<form action="{% url 'charge' %}" method="post" id="payment-form">
<div class="form-field-12">
<label for="amount"><b>Pick a product from this dropdown:</b></label>
<select required name="amount" id="amount">
<option selected value="1">$1 CAD ------> TEST</option>
<option value="1">$1 CAD -----> 1 item</option>
<option value="2">$2 CAD -----> 2 items</option>
<option value="3">$3 CAD ----> 3 items</option>
<option value="4">$4 CAD ----> 4 items</option>
<option value="5">$5 CAD ---> 5 items</option>
</select>
</div>
<div class="form-field-6">
<label for="email"><strong>* Enter your email address:</strong></label>
<input required type="email" name="email" placeholder="* email...">
</div>
<div class="form-field-6">
<label for="username"><strong>* Desired username / login name:</strong></label>
<input required type="text" name="username" placeholder="* username...">
</div>
<div class="form-field-6">
<label for="email"><strong>Enter your Dogs name:</strong></label>
<input type="text" name="dog" placeholder="Dogs name...">
</div>
<div class="form-field-6">
<label for="email"><strong>Enter your Favorite beer:</strong></label>
<input type="text" name="beer" placeholder="Favorite beer...">
</div>
<div class="form-field-6">
<label for="country"><strong>* Enter your Country:</strong></label>
<input required type="text" name="country" placeholder="* Country...">
</div>
<div class="form-field-6">
<label for="phone"><strong>* Enter your phone number:</strong></label>
<input type="tel" id="phone" name="phone" placeholder="* Phone..."
pattern="[0-9]{3}-[0-9]{3}-[0-9]{4}"
required>
<small>Format: 123-456-7890</small>
</div>
<div class="form-row">
<label for="card-element">
<strong>Credit or debit card</strong>
</label>
<div id="card-element">
<!-- A Stripe Element will be inserted here. -->
</div>
<!-- Used to display form errors. -->
<div id="card-errors" role="alert">
</div>
</div>
<div style="clear:left">
</div>
<hr>
<input id="fjButton" style="background-color:#10a195;height:12px" type="submit" value="Submit Payment" name="">
<hr>
<a href="https://opp.ca" target="_blank" id="fjButton2" style="background-color:#10a195; height:77px" >OPP Homepage</a>
<br><br><br><br>
</form>
</div>
</div>
<div class="column-6">
<div id="right-wrapper">
<img class="form-field-12" src="{% static 'images/Z9999.png' %}">
<h3> We appreciate you!</h3>
<hr>
</div>
</div>
</div>
<script>
// Create a Stripe client.
var stripe = Stripe('pk_live_blahblah');
// Create an instance of Elements.
var elements = stripe.elements();
// Custom styling can be passed to options when creating an Element.
// (Note that this demo uses a wider set of styles than the guide below.)
var style = {
base: {
color: '#32325d',
fontFamily: '"Helvetica Neue", Helvetica, sans-serif',
fontSmoothing: 'antialiased',
fontSize: '16px',
'::placeholder': {
color: '#aab7c4'
}
},
invalid: {
color: '#fa755a',
iconColor: '#fa755a'
}
};
// Create an instance of the card Element.
var card = elements.create('card', {style: style});
// Add an instance of the card Element into the `card-element` <div>.
card.mount('#card-element');
// Handle real-time validation errors from the card Element.
card.addEventListener('change', function(event) {
var displayError = document.getElementById('card-errors');
if (event.error) {
displayError.textContent = event.error.message;
} else {
displayError.textContent = '';
}
});
// Handle form submission.
var form = document.getElementById('payment-form');
form.addEventListener('submit', function(event) {
event.preventDefault();
stripe.createToken(card).then(function(result) {
if (result.error) {
// Inform the user if there was an error.
var errorElement = document.getElementById('card-errors');
errorElement.textContent = result.error.message;
} else {
// Send the token to your server.
stripeTokenHandler(result.token);
}
});
});
// Submit the form with the token ID.
function stripeTokenHandler(token) {
// Insert the token ID into the form so it gets submitted to the server
var form = document.getElementById('payment-form');
var hiddenInput = document.createElement('input');
hiddenInput.setAttribute('type', 'hidden');
hiddenInput.setAttribute('name', 'stripeToken');
hiddenInput.setAttribute('value', token.id);
form.appendChild(hiddenInput);
// Submit the form
form.submit();
}
</script>
</body>
</html>
I found this finally... CSS - Why am I not able to set height and width of <a href> elements? and as it states...
"As the others have said, by default is an inline element, and inline elements can't specify a width or height. You can change it to be a block element like this":
a {
display: block;
}
Though it will then display (unsurprisingly) as a block, sitting on its own, outside the flow of the surrounding text. A better solution is to use display: inline-block which might be a best-of-both-worlds solution depending on your situation.
a {
display: inline-block;
}
Height won't have any effect on that <a> tag as it has a display of inline, so you simply need to change its display to something like inline-block to make it obey the set height, like
#fjButton2 {
box-shadow: 0 1px 3px 0 #dce0e6;
font-family:'Fjalla One', sans-serif;;
border-radius: 4px;
background-color: #fff;
border: 1px solid transparent;
color: #44464a;
height: 14px !important;
width: 30%;
padding: 5px;
font-size: 16px;
text-decoration:none;
margin: 0px;
display:inline-block;
}
Hope it helps.
What I would like is to have a column of labels, and to the right a column of text boxes approximately a few tabs apart and all aligned on (their respective) margins.
So far I have this. However when I resize the screen my text boxes move. How can I make them fixed?
This is the CSS:
#layout {
background-color: #f5fffa;
width: 600px;
padding: 20px;
border: 5px solid black;
margin: 0 auto;
color: black;
font-family: arial;
font-size: 15px;
font-weight: bold;
}
#zero {
text-align: center;
}
#one {
-moz-border-radius:7px;
-webkit-border-radius:7px;
border-radius:7px;
border:4px solid #18ab29;
border-width: 4px;
background-color: #44c767;
color:#ffffff;
padding-left: 9em;
padding-right: 9em;
}
.myform {
width:40px;
text-align: left;
position: absolute;
right: 800px;
height: 1.5em;
}
This is the HTML:
<div id="layout">
<h1 id="zero">Title</h1>
<form id="one">
<br>
<label>input one:</label>
<input type="text" class="myform" value="0" /><br><br>
<label>input two:</label>
<input type="text" class="myform" value="0" /></br>
</br>
</form>
</div>
EDIT:
I've figured it out:
Add this:
#one label {
display: inline-block;
width: 270px;
}
And take away:
position: absolute;
right: 800px;
from
.myform {
width:40px;
text-align: left;
position: absolute;
right: 800px;
height: 1.5em;
}
try to give the label a width:
label {
width: 100px;
}
#layout {
background-color: #f5fffa;
width: 600px;
padding: 20px;
border: 5px solid black;
margin: 0 auto;
color: black;
font-family: arial;
font-size: 15px;
font-weight: bold;
}
#zero {
text-align: center;
}
#one {
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
border: 4px solid #18ab29;
border-width: 4px;
background-color: #44c767;
color: #ffffff;
height: 1.5em;
}
.myform {
text-align: left;
position: absolute;
right: 800px;
}
.leftCol {
float: left;
width: 50%
}
.rightCol {
float: right;
width: 50%
}
<div id="layout">
<h1 id="zero">Title</h1>
<form id="one">
<div class="leftCol">
<label>input one:</label>
<input type="text" value="0" />
</div>
<div class="rightCol">
<label>input two:</label>
<input type="text" value="0" />
</div>
</form>
</div>
I removed the position:absolute from the inputs (because in my screen they where way of, that's why you should use it if nothing else works) and then added a margin-right on the form labels. demo;
Relevant CSS
#one label{
margin-right:10px;
}
Update
I've added a fixed width to ammend for the possibility of labels with differente text lengths, here it is:
#one label{
display:inline-block;
margin-right:10px;
width:150px;
}
You should change width:150px to whatever you want it to be :)
Hope it helps!
('Boy... I saw on search that misalign topic about the <input> wrapped on an <a> tag... LOL)
Anyway...
I'm in a bit of a pickle here... I have a bunch of divs as an inline block lead by a lone <button>, and this lone button --- no matter how much design genius I summon from myself, I can't get to align properly.
Just look at the code at the end of the post.
Notes:
The button-holder class didn't used to exist; it was just the <button><span> combo. I added it thinking I can fix it by doing negative values on the margin (to no avail).
Can anyone advise?
FULL code:
<style type="text/css">
body { margin:0; padding:0;font-size: 9pt; }
#main { margin: 0; padding: 0; width:100%; text-align:center; }
#bar {display: table; margin: 0; padding: 0; width:100%; height:45px }
[class~=banner] { font-size: 14pt;
font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
display: table-cell;
height: 45px;
vertical-align: middle;}
.cellOne { background-color:#FFC316;
color: #35549A;
width: 8%;
text-align:center;}
.cellTwo { background-color: #35549A;
color: #FFF;
padding: 0px 0px 0px 2%;
width: 68%;
text-align: left;}
.cellThree { background-color: #35549A;
color: #FFC316;
width: 12%;
text-align: left;}
#three_element {margin: 0 auto; padding:0% 18.5% 0% 18.5%; text-align:center; }
.button-holder {
width: 250px;
height: calc(250px / 1.604);
margin: -1.45% 1.5% -1.65% 1.5%;
display:inline-block;
padding:5px;
box-sizing:border-box;
}
#addbutton {
border-radius: 25px 25px 25px 25px;
-moz-border-radius: 25px 25px 25px 25px;
-webkit-border-radius: 25px 25px 25px 25px;
display:table;
border: 0px;
box-sizing:border-box;
padding:0px;
margin:0px;
background-color:#E6E7E8;
text-align:center;}
#addbutton .add {
display: table-cell;
font-size: calc(250px / 1.604 - 50px);
color: #384D94;
width: 240px;
height: calc(240px / 1.604);
vertical-align: middle;
margin: 0px;
padding: 0px;
box-sizing: border-box;
}
[class~=objective-edit-tile] {
width: 250px;
height: calc(250px / 1.604);
margin: 1.5%;
display:inline-block;
box-sizing:border-box;
padding:5px;}
[class~=objective-edit-tile] div {
font-family:"Yanone Kaffeesatz","Arial Narrow",Arial,sans-serif;
box-sizing:border-box;
color:#FFFFFF;
margin:0px;
display:inline-block;
}
.tr-1-square-red div {background-color: #BE1E2D;}
.tr-1-square-yellow div {background-color: #E39F15;}
.tr-1-square-green div {background-color:#266733;}
.text-block-name {
border-radius: 25px 25px 0px 0px;
-moz-border-radius: 25px 25px 0px 0px;
-webkit-border-radius: 25px 25px 0px 0px;
border:#FFFFFF 1px solid;
width: 100%;
height: 66.7%;
font-size: 180%;
padding-top:17%;
}
.text-block-days {
border-radius: 0px 0px 0px 25px;
-moz-border-radius: 0px 0px 0px 25px;
-webkit-border-radius: 0px 0px 0px 25px;
border-top: #FFF 1px solid;
font-weight:700;
width: 34%;
height: 33%;
padding-top:6.5%;}
.text-block-next-step {
border-radius: 0px 0px 25px 0px;
-moz-border-radius: 0px 0px 25px 0px;
-webkit-border-radius: 0px 0px 25px 0px;
border-top: #FFF 1px solid;
font-size:9px;
width: 64%;
height: 33%;
padding:8% 2px 0px 1px;}
</style>
</head>
<body>
<div id="main">
<div id="bar">
<div class="banner cellOne">Pipeline</div>
<div class="banner cellTwo"> <Title> </div>
<div class="banner cellThree">PracticePipeline.com</div>
</div>
<div role="content" id="three_element">
<div class="button-holder">
<button id="addbutton" name="buttton">
<span class = "add">+</span>
</button>
</div>
<div class = "tr-1-square-red objective-edit-tile" id="tile-n">
<div class = "text-block-name" >GGN </div>
<div class = "text-block-days" > -10 Days</div>
<div class = "text-block-next-step" >Research GGN background </div>
</div>
<div class = "tr-1-square-yellow objective-edit-tile " id="tile-n">
<div class = "text-block-name" >GGN </div>
<div class = "text-block-days" > -10 Days</div>
<div class = "text-block-next-step" >Research GGN background </div>
</div>
<div class = "tr-1-square-green objective-edit-tile " id="tile-n">
<div class = "text-block-name" >Stark Indust.. </div>
<div class = "text-block-days" > 7 Days</div>
<div class = "text-block-next-step" >Invite Stark Industri.. </div>
</div>
</div>
</div>
</body>
I dont know if this is going to help much but it worked when i tried it.
The tag padding-bottom keep making a little bit higher if you want it to align better.
#addbutton .add {
display: table-cell;
font-size: calc(250px / 1.604 - 50px);
color: #384D94;
width: 240px;
height: 140px;
vertical-align: middle;
margin: 0px;
padding: 0px;
box-sizing: border-box;
padding-bottom: 7%
}
I actually solved my own problem:
The problem was just that I was over analyzing things. Basic lay-outing worked:
.button-holder {
margin:1.5%;
display:inline-block;
padding:5px;
box-sizing:border-box;
}
#addbutton {
border-radius: 25px 25px 25px 25px;
-moz-border-radius: 25px 25px 25px 25px;
-webkit-border-radius: 25px 25px 25px 25px;
width: 240px;
height: calc(250px / 1.604 - 10px);
border: 0px;
margin:0px;
padding: 0px;
background-color:#E6E7E8;
box-sizing:border-box;
text-align:center;
}
#addbutton .add {
font-size: 97px;
color: #384D94;
}
I have a page and a form element that I have positioned on the right side of the page, when I resize the page the form moves to the left of the page, this is very irritating and I want to keep the element fixed.
The element is <div id = "form1"> in the below code:
<center>
<div id = "text">
<p>Angus Animal Sanctuary is a small animal centre located in Birmingham, UK. Our focus is on more traditional pets like cat, dogs, rabbits and birds. The objectives of this association are to take in and re-home animals and provide a special living environment. </p>
<p>An animal adoption makes a unique gift idea for yourself or someone special and provides a valuable contribution to the running costs of Angus. With the help of our staff and volunteers we provide a special and loving atmosphere to help all our animals adapt and find permanent, loving new homes.</p>
<p>All potential adopters are interviewed and home vetted.</p>
</div>
<div id = "form1">
<form method="login" action="form1.php">
<center><h3>Login</h3></center>
<label>Email*:</label> <input type="text" name="name" size="15" maxlength="20" placeholder="abc#mail.co.uk" required value="<?php echo htmlspecialchars($email);?>"/>
<br/><div class="error"><?php if (!empty($emailErr)){echo $emailErr;}?></div>
<br/>
<label>Password*:</label> <input type="text" name="name" size="15" maxlength="20" placeholder="**********" required value="<?php echo htmlspecialchars($password);?>"/>
<br/><div class="error"><?php if (!empty($passwordErr)){echo $passwordErr;}?></div>
<br/>
<b><input style="float:right" type="Submit" name="Submit" value="Sign In"/></b>
</form>
</div>
<br/>
</center>
CSS:
#container{
width:979px;
margin:0;
padding: 0;
}
body{
min-width:947px;
}
/* change padding to increase or decrease size */
#header{
background-color:#C8C800;
margin: auto;
padding:0px 0px;
text-align: center;
height:150px;
width:950px;
border: 1px solid #999;
border-radius: 5px;
-moz-box-shadow: 0 0 100px #999;
-webkit-box-shadow: 0 0 100px #999;
box-shadow: 0 0 100px #999;
}
#form1{
margin-top:-250px;
background-color:#FBFBE8;
margin-right:190px;
float:right;
padding:0;
width:240px;
height:180px;
border:1px solid #999;
border-radius: 5px;
-moz-box-shadow: 0 0 100px #999;
-webkit-box-shadow: 0 0 100px #999;
box-shadow: 0 0 100px #999;
display:inline;
}
/* Main setting of the nav bar */
#nav{
background-color:#C8C800;
overflow:hidden;
text-align: center;
border: 1px solid #999;
border-radius: 5px;
-moz-box-shadow: 0 0 100px #999;
-webkit-box-shadow: 0 0 100px #999;
box-shadow: 0 0 100px #999;
width:950px;
text-align: left;
border:0px;
padding: 0;
margin: 0 auto;
}
/* Styling to change anything which goes on the navbar itself */
#nav ul {list-style:none;
text-align: center;
margin: 4px; /* This changes height of navbar (orange bar)*/
font-family: BOOK ANTIQUA;
font-size: 20px;
font-weight: bold;
font-style: italic;
}
#nav li {
display: inline;
}
/* Styling to change the specific button / link of navbar (li) because it is reffering to lists*/
#nav li a {
text-decoration:none;
color:#000;
padding: 20px 20px; /* This changes width and height of the buttons, edit 2nd one to increase/decrease spacing between links*/
background-color:#C8C800;
}
/* Styling to change the specific button / link of navbar */
#nav li a:hover {
color: #FFF;
background-color: black;
}
#text{
line-height:0.65cm;
width:680px;
margin-right:270px;
margin-top:-40px;
height:250px;
background-color:#FBFBE8;
border-radius: 5px;
moz-box-shadow: 0 0 100px #999;
webkit-box-shadow: 0 0 100px #999;
box-shadow: 0 0 100px #999;
}
#footer{
background-color:#C8C800;
margin-top: -20px;
border-radius: 5px;
moz-box-shadow: 0 0 100px #999;
webkit-box-shadow: 0 0 100px #999;
box-shadow: 0 0 100px #999;
width: 945px;
}
Normaly i do not do this. But since I like animals, I gave your markup a little retuch. It's not complete but i think it will help you out: http://jsfiddle.net/NicoO/Yqbg5/1/
*
{
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
#wrap
{
width: 950px;
margin: auto;
}
#header
{
background-color: #C8C800;
border: 1px solid #999999;
border-radius: 5px;
box-shadow: 0 0 30px #999999;
margin: auto;
padding: 75px;
text-align: center;
}
#navigation
{
display: block;
margin:20px 0px;
padding:0;
list-style: none;
text-align: center;
background-color: #C8C800;
border-radius: 5px;
border: 1px solid #999999;
box-shadow: 0 0 20px #999999;
}
#navigation > li
{
display: inline-block;
vertical-align: middle;
}
#navigation > li A
{
font-weight:bold;
font-style: italic;
display: block;
padding: 10px;
font-size: 20px;
color: #000;
text-decoration: none;
}
#navigation > li A:hover,
#navigation > li A:focus
{
background-color: #000;
color: #FFF;
}
#slideshow
{
border:1px solid black;
clear: left;
margin-bottom: 15px;
text-align: center;
background-color: white;
border-radius: 5px;
}
.box
{
background-color: #FBFBE8;
border: 1px solid #999999;
border-radius: 5px;
box-shadow: 0 0 30px #999999;
padding: 15px;
}
.claimer
{
font-size: 50px;
font-style: italic;
}
#left
{
width:71.5%;
float: left;
padding-right: 20px;
}
#right
{
margin-left: 71.5%;
}
#content:after
{
content: "";
display: table;
clear: both;
}
#footer
{
background-color: #C8C800;
border-radius: 5px;
box-shadow: 0 0 30px #999999;
margin-top: 15px;
}
h3
{
display: block;
text-align: center;
}
You will ned to change your HTML to this:
<div id="wrap">
<div id="header">
<span class="claimer">Angus Animal Sanctuary</span>
</div>
<ul id="navigation">
<li>Home</li>
<li>About us</li>
<li>Register</li>
<li>Contact us</li>
</ul>
<div id="slideshow">
<img name="slide" src="http://www.katellaclinic.com/clients/6909/images/bigstock_Group_Of_Pets_Together_In_Fron_8258872.jpg" />
</div>
<div id="content">
<div id="left">
<div class="box">
<h3>Welcome to Angus Animal Sanctuary</h3>
<p>Angus Animal Sanctuary is a small animal centre located in Birmingham, UK. Our focus is on more traditional pets like cat, dogs, rabbits and birds. The objectives of this association are to take in and re-home animals and provide a special living environment. </p>
<p>An animal adoption makes a unique gift idea for yourself or someone special and provides a valuable contribution to the running costs of Angus. With the help of our staff and volunteers we provide a special and loving atmosphere to help all our animals adapt and find permanent, loving new homes.</p>
<p>All potential adopters are interviewed and home vetted.</p>
</div>
</div>
<div id="right">
<div class="box">
<form action="form1.php" method="login">
<h3>Login</h3>
<label for="name">Email*:</label>
<input type="text" value="" required="" placeholder="abc#mail.co.uk" maxlength="20" size="15" id="name" name="name" />
<label for="password">Password*:</label>
<input type="password" value="" required="" placeholder="" maxlength="20" size="15" id="password" name="password" />
<input type="Submit" value="Sign In" name="Submit" />
</form>
</div>
</div>
</div>
<div id="footer">
<marquee><b>All Content Copyright 2014</b></marquee>
</div>
</div>
Add this to your CSS
#form1{
position:relative;
left:195px;}
It should help.
Wrap the form with a div, then add the css posion: relative to this div.
I am trying to make my text-fields expand when the container does. This is a picture of my container along with my text fields:
Now when I expand the Product Link text-field it results to this:
When it should be making the box bigger in height. This is my css I am using for the container and text-fields:
CSS
/* UserPrice Container & Fields */
#user-price-container {
background:#FFFFFF;
border:black solid 1px;
font-family:Arial, Helvetica, sans-serif;
margin-top:5px;
width: 950px;
}
.user_price_labels {
margin-left:5px;
font-weight:bold;
color:#78AF00;
}
.user-price-fields {
font-family:Arial, Helvetica, sans-serif;
border-right: 1px solid #90BF22;
border-style: solid;
border-width: 1px;
box-shadow: 0 1px 0 #FFFFFF, 0 1px 1px rgba(0, 0, 0, 0.17) inset;
color: #333333;
font-size: 13px;
-moz-box-sizing: border-box;
background: #FFFFFF;
border-color: black;
border-radius: 1px 1px 1px 1px;
display: inline-block;
height: 25px;
padding-left: 8px;
margin-left:5px;
}
/* Individual Text-fields*/
#user-price-price, #user-price-product, #user-price-exact-url {
margin-top:-2px;
}
#user-price-product-container {
margin-top:5px;
margin-left:5px;
}
#user-price-price-container {
margin-top:5px;
}
#user-price-product-store-container {
margin-top:-14px;
height:35px;
}
#user-price-exact-url-container {
margin-left:44px;
margin-top:-14px;
height:35px;
}
HTML(960gs)
<div id="user-price-container" class="grid_24">
<p id="user-price-product-container" class="grid_12"><label class="user_price_labels" for="user_prices_0_product_name">Product*</label><br />
<input class="user-price-fields" data-autocomplete="/prices/autocomplete_product_name" id="user-price-product" name="user_prices[0][product_name]" size="60" type="text" /></p>
<p id="user-price-price-container" class="grid_4"><label class="user_price_labels" for="user_prices_0_price">Price*</label><br />
<input autocomplete="off" class="user-price-fields" id="user-price-price" name="user_prices[0][price]" placeholder="00.00" size="10" type="text" /></p>
<p id="user-price-product-store-container" class="grid_11"><label class="user_price_labels" for="user_prices_0_product_store">Location*</label><br />
<input class="product_store" id="user_prices_0_product_store" name="user_prices[0][product_store]" size="30" type="text" /></p>
<p id="user-price-exact-url-container" class="grid_9"><label class="user_price_labels" for="user_prices_0_exact_url">Product Link</label><br />
<textarea class="user-price-fields" cols="40" id="user-price-exact-url" name="user_prices[0][exact_url]" rows="20"></textarea></p>
</div>
How can I get it to expand dynamically in width?
Thank you for taking the time to read this.
Remove the height from this class and I think it will work, maybe change it to min-height instead of removing it.
#user-price-exact-url-container {
margin-left:44px;
margin-top:-14px;
height:35px;
}
#user-price-exact-url-container{
resize: both;
overflow: auto;
min-width: 400px; /*suggest a mid-width & min-height*/
min-height: 400px;
}
I suggest the code above.