i got a "news" thing on my navigation bar, it uses marquee to have moving text but when the text gets too long, it pushes my content (not the content of the navigation bar but the main content on the website). it is also unable to start from the beginning of the navigation bar and rather chose to start from the middle but really depends on how long the text is...
navigationbar.php
<?php
function echoSelectedClassIfRequestMatches($requestUri)
{
$current_file_name = basename($_SERVER['REQUEST_URI']);
if ($current_file_name == $requestUri)
echo 'class="selected"';
}
?>
<!--START NAVIGATION-->
<div class="nav-align">
<div class="social-wrapper">
Social Media :
<i class="fa fa-facebook-official"></i><!--facebook-->
<i class="fa fa-twitter-square"></i><!--twitter-->
<i class="fa fa-youtube-play"></i><!--youtube-->
<i class="fa fa-google-plus-square"></i><!--google+-->
<i class="fa fa-instagram"></i><!--instagram-->
<i class="fa fa-steam-square"></i><!--steam-->
</div>
<nav class="nav-main">
<a href="/">
<img class="logo" src=""></img>
</a>
<?php
if(empty($_SESSION['user'])){
echo'<div class="user-container">';
echo'You are signed in as guest, please';
echo'Sign In';
echo'or';
echo'Sign Up';
echo'</div>';
}else {
echo'<div class="user-container">';
echo"<span><i class='fa fa-wrench'></i></span> <a class='a' href='/settings'> Settings";
echo"</a>";
echo" | ";
echo'<a class="a" href="/user/';
echo htmlentities($_SESSION['user']['id'], ENT_QUOTES, 'UTF-8');
echo '">';
echo htmlentities($_SESSION['user']['username'], ENT_QUOTES, 'UTF-8');
echo'</a> <span><i class="fa fa-user"></i></span>
Sign Out <i class="fa fa-sign-out"></i>';
echo'</div>';
}
?>
</nav>
<div class="nav-item-container">
<ul>
<li>
<div <?=echoSelectedClassIfRequestMatches("")?>>Home </div>
</li>
<li>
<div <?=echoSelectedClassIfRequestMatches("about")?>>About </div>
</li>
<li>
<div <?=echoSelectedClassIfRequestMatches("contact")?>>Contact </div>
</li>
<li>
<div <?=echoSelectedClassIfRequestMatches("forum")?>>Forum </div>
</li>
<li>
<div <?=echoSelectedClassIfRequestMatches("upload")?>>Upload </div>
</li>
<li>
<div <?=echoSelectedClassIfRequestMatches("server")?>>Server </div>
</li>
<li>
<div <?=echoSelectedClassIfRequestMatches("clan")?>>Clan </div>
</li>
<li>
<div <?=echoSelectedClassIfRequestMatches("misc")?>>Misc </div>
</li>
<div class="news-wrapper">
<div class="news-content">
<i class="fa fa-bullhorn"></i> NEWS :
</div>
</div>
</ul>
<ul>
<li style="overflow:hidden;">
<div class="marquee-wrapper">
<marquee behavior="scroll" direction="left" scrollamount="4" onmouseover="this.stop();" onmouseout="this.start();">
<?php
$items = Array(
"<span><i class='fa fa-bullhorn'></i> NEWS:</span> Welcome to the website!",
"Welcome <span> <a class='a2' href='/user/'>".htmlentities($row['username'], ENT_QUOTES, 'UTF-8')."</a></span> to the website!",
"We currently got <span> ".htmlentities($row['id'], ENT_QUOTES, 'UTF-8')." </span> Unique members :)",
//"You can easly visit other members profiles by typing '/user/[id]' just replace [id] by any number.",
);
echo $items[array_rand($items)];
?>
</marquee>
</div>
</li>
</ul>
</div>
</div>
nav-bar.css
#charset "utf-8";
.nav-align {
width:85.1%;
padding-top:40px;
margin:auto;
}
.nav-main{
margin:auto;
background-image: url("/images/background/navigationbar.jpg") !important;
border: 1px solid #000;
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .3), inset 0 1px 1px rgba(255, 255, 255, .2);
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .3), inset 0 1px 1px rgba(255, 255, 255, .2);
box-shadow: 0 1px 3px rgba(0, 0, 0, .3), inset 0 1px 1px rgba(255, 255, 255, .2);
height:80px;
color:#858d9a;
z-index:50;
}
.nav-main .logo{
float:left;
color:#fff;
text-decoration: none;
width:20%;
padding:5px 20px;
font-size:1.4em;
line-height:30px;
}
.user-container {
float:right !important;
height:30px;
padding: 20px 20px;
font-size:15px;
}
.nav-item-container {
border-left:1px solid black;
border-right:1px solid black;
background-color: #1d1d1d;
background-image: -webkit-linear-gradient(bottom, #1a1b1f, #212528);
background-image: -moz-linear-gradient(bottom, #1a1b1f, #212528);
background-image: -o-linear-gradient(bottom, #1a1b1f, #212528);
background-image: linear-gradient(to top, #1a1b1f, #212528);
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .3), inset 0 1px 1px rgba(255, 255, 255, .2);
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .3), inset 0 1px 1px rgba(255, 255, 255, .2);
box-shadow: 0 1px 3px rgba(0, 0, 0, .3), inset 0 1px 1px rgba(255, 255, 255, .2);
height:30px;
}
.nav-item-container > ul{
float:left;
list-style-type:none;
overflow:hidden;
}
.nav-item-container > ul > li{
float:left;
}
.nav-item{
font-size:12px;
display:inline-block;
padding:5px 10px;
height:20px;
line-height:20px;
color:#7D91A3;
text-decoration:none;
}
.selected {
color:#05c7f7 !important;
}
.nav-item:hover {
color:#fff;
text-shadow: 0 1px 2px #000;
-webkit-box-shadow: 0 0 10px rgba(5,199,247,0.5), inset 0 0 1px 1px #05c7f7;
-moz-box-shadow: 0 0 10px rgba(5,199,247,0.5), inset 0 0 1px 1px #05c7f7;
box-shadow: 0 0 10px rgba(5,199,247,0.5), inset 0 0 1px 1px #05c7f7;
background-image: linear-gradient(to top, #096aa1, #26c3f6);
}
.nav-content{
position:absolute;
top:184px;
overflow:hidden;
background-color:#0d0f11;
max-height:0;
}
.nav-content a{
color:#fff;
text-decoration:none;
}
.nav-sub{
padding:10px;
}
.nav-sub ul{
padding:0;
margin:0;
list-style-type:none;
}
.nav-sub ul li a{
display:inline-block;
padding:3px 0;
padding-left:10px;
color:#7D91A3;
}
.nav-sub ul li a:hover{
color:#05c7f7;
}
.nav-item:focus ~ .nav-content{
max-height:100px;
border-left: 1px solid #000;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
background-color: #1d1d1d;
background-image: -webkit-linear-gradient(bottom, #1a1b1f, #212528);
background-image: -moz-linear-gradient(bottom, #1a1b1f, #212528);
background-image: -o-linear-gradient(bottom, #1a1b1f, #212528);
background-image: linear-gradient(to top, #1a1b1f, #212528);
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .3), inset 0 1px 1px rgba(255, 255, 255, .2);
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .3), inset 0 1px 1px rgba(255, 255, 255, .2);
box-shadow: 0 1px 3px rgba(0, 0, 0, .3), inset 0 1px 1px rgba(255, 255, 255, .2);
z-index:4000;
}
.social-wrapper {
border-top:1px solid black;
border-left:1px solid black;
border-right:1px solid black;
background-image: -webkit-linear-gradient(bottom, #1a1b1f, #212528);
background-image: -moz-linear-gradient(bottom, #1a1b1f, #212528);
background-image: -o-linear-gradient(bottom, #1a1b1f, #212528);
background-image: linear-gradient(to top, #1a1b1f, #212528);
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .3), inset 0 1px 1px rgba(255, 255, 255, .2);
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .3), inset 0 1px 1px rgba(255, 255, 255, .2);
box-shadow: 0 1px 3px rgba(0, 0, 0, .3), inset 0 1px 1px rgba(255, 255, 255, .2);
width:20%;
min-width:230px;
padding-left:10px;
padding-right:10px;
line-height:30px;
height:30px;
margin:auto;
}
.social-wrapper:hover {
color:#05c7f7;
}
.nav-social-icons {
padding-top:6px !important;
line-height:21.5px;
font-size:17px;
padding:3px;
color:#777f8c;
float:right;
}
.nav-social-icons:hover {
color:#fff;
-webkit-box-shadow: 0 0 10px rgba(5,199,247,0.5), inset 0 0 1px 1px #05c7f7;
-moz-box-shadow: 0 0 10px rgba(5,199,247,0.5), inset 0 0 1px 1px #05c7f7;
box-shadow: 0 0 10px rgba(5,199,247,0.5), inset 0 0 1px 1px #05c7f7;
background-image: linear-gradient(to top, #096aa1, #26c3f6);
}
.news-content {
background-color:#05c7f7;
color:#05c7f7;
padding:3px;
width:100%;
float:right;
font-weight:bold;
line-height:25px;
background-color: #1d1d1d;
-webkit-box-shadow: inset 0 1px 1px rgba(255, 255, 255, .2);
-moz-box-shadow: inset 0 1px 1px rgba(255, 255, 255, .2);
box-shadow: inset 0 1px 1px rgba(255, 255, 255, .2);
border: 1px solid #000;
background-image: -webkit-linear-gradient(bottom, #1a1b1f, #212528);
background-image: -moz-linear-gradient(bottom, #1a1b1f, #212528);
background-image: -o-linear-gradient(bottom, #1a1b1f, #212528);
background-image: linear-gradient(to top, #1a1b1f, #212528);
-webkit-transition: all .2s ease-in-out;
-moz-transition: all .2s ease-in-out;
-ms-transition: all .2s ease-in-out;
-o-transition: all .2s ease-in-out;
}
.news-content:before {
-webkit-transition: all .3s ease-in-out;
-moz-transition: all .3s ease-in-out;
-ms-transition: all .3s ease-in-out;
-o-transition: all .3s ease-in-out;
}
.marquee-wrapper {
line-height:30px !important;
float:right;
}
.news-wrapper {
padding-left:120px !important;
float:right;
line-height:25px;
}
a wrapper above all content
.content-wrapper { background-image: url("/images/background/content.jpg") !important; width:85%; border: 1px solid #000; background-image: -webkit-linear-gradient(bottom, #1a1b1f, #212528); background-image: -moz-linear-gradient(bottom, #1a1b1f, #212528); background-image: -o-linear-gradient(bottom, #1a1b1f, #212528); background-image: linear-gradient(to top, #1a1b1f, #212528); margin:auto;}
Do not use the <marquee> element, it is deprecated.
“This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.”
https://developer.mozilla.org/en/docs/Web/HTML/Element/marquee
But to fix your problem you could try adding overflow: hidden to either .marquee-wrapper or .marquee-wrapper marquee
Related
I have a button, and its background is white, with a 2px border. On :hover event, I created a transition to a colored background, but when the mouse is out, the background flashes to white immediately, instead of smoothly animates back to white.
What am I missing?
html input[type="button"],
.form-submit input[type="submit"] {
margin: 10px 5px 10px 5px;
-webkit-appearance: button;
cursor: pointer;
font-family: Aktiv-Grotesk, Verdana, Geneva, sans-serif;
font-weight: normal;
font-size: 13px;
padding: 9px 15px;
text-transform: uppercase;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
box-shadow: none;
cursor: pointer;
border: 2px solid #ff2e54;
;
-webkit-border-radius: 40px;
border-radius: 40px;
color: #ff2e54;
text-align: center;
-o-text-overflow: clip;
text-overflow: clip;
letter-spacing: 1px;
background: #fff;
-webkit-transition: all 0.3s cubic-bezier(0, 0, 0, 0);
-moz-transition: all 0.3s cubic-bezier(0, 0, 0, 0);
-o-transition: all 0.3s cubic-bezier(0, 0, 0, 0);
transition: all 0.3s cubic-bezier(0, 0, 0, 0);
}
html input[type="button"]:hover,
.form-submit input[type="submit"]:hover {
background: rgba(255, 45, 84, 1);
background: -moz-linear-gradient(left, rgba(255, 45, 84, 1) 0%, rgba(255, 12, 72, 1) 100%);
background: -webkit-gradient(left top, right top, color-stop(0%, rgba(255, 45, 84, 1)), color-stop(100%, rgba(255, 12, 72, 1)));
background: -webkit-linear-gradient(left, rgba(255, 45, 84, 1) 0%, rgba(255, 12, 72, 1) 100%);
background: -o-linear-gradient(left, rgba(255, 45, 84, 1) 0%, rgba(255, 12, 72, 1) 100%);
background: -ms-linear-gradient(left, rgba(255, 45, 84, 1) 0%, rgba(255, 12, 72, 1) 100%);
background: linear-gradient(to right, rgba(255, 45, 84, 1) 0%, rgba(255, 12, 72, 1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ff2d54', endColorstr='#ff0c48', GradientType=1);
border: 2px solid rgba(255, 255, 255, 0);
color: #fff;
-webkit-box-shadow: 0px 2px 7px -1px rgba(255, 45, 85, 0.5);
-moz-box-shadow: 0px 2px 7px -1px rgba(255, 45, 85, 0.5);
-o-box-shadow: 0px 2px 7px -1px rgba(255, 45, 85, 0.5);
box-shadow: 0px 2px 7px -1px rgba(255, 45, 85, 0.5);
}
html input[type="button"]:active,
.form-submit input[type="submit"]:active {
border: 2px solid #ff607f;
background: #ff607f!important;
color: #eee;
-webkit-box-shadow: 0px 1px 1px 0px #c12140;
-moz-box-shadow: 0px 1px 1px 0px #c12140;
-o-box-shadow: 0px 1px 1px 0px #c12140;
box-shadow: 0px 1px 1px 0px #c12140;
}
html input[type="button"]:disabled,
.form-submit input[type="submit"]:disabled {
-webkit-transition: all .2s ease-in-out 2s;
-moz-transition: all .2s ease-in-out 2s;
-o-transition: all .2s ease-in-out 2s;
transition: all .2s ease-in-out 2s;
cursor: default;
background-color: #fff;
border: 2px solid #E1E1E1;
color: #BBB;
box-shadow: none;
}
<input value="Download" type="button" onclick="this.disabled=true; this.value='Starting..';location.href='#'">
As far as a I know background gradients don't support transitions, so you have to get rid of the gradient (which is hard to see anyway) then it works:
html input[type="button"],
.form-submit input[type="submit"] {
margin: 10px 5px 10px 5px;
-webkit-appearance: button;
cursor: pointer;
font-family: Aktiv-Grotesk, Verdana, Geneva, sans-serif;
font-weight: normal;
font-size: 13px;
padding: 9px 15px;
text-transform: uppercase;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
box-shadow: none;
cursor: pointer;
border: 2px solid #ff2e54;
;
-webkit-border-radius: 40px;
border-radius: 40px;
color: #ff2e54;
text-align: center;
-o-text-overflow: clip;
text-overflow: clip;
letter-spacing: 1px;
background: rgba(255, 255, 255, 1);
-webkit-transition: all 0.3s cubic-bezier(0, 0, 0, 0);
transition: all 0.3s cubic-bezier(0, 0, 0, 0);
}
html input[type="button"]:hover,
.form-submit input[type="submit"]:hover {
background: rgba(255, 45, 84, 1);
border: 2px solid rgba(255, 255, 255, 0);
color: #fff;
-webkit-box-shadow: 0px 2px 7px -1px rgba(255, 45, 85, 0.5);
box-shadow: 0px 2px 7px -1px rgba(255, 45, 85, 0.5);
}
html input[type="button"]:active,
.form-submit input[type="submit"]:active {
border: 2px solid #ff607f;
background: #ff607f!important;
color: #eee;
-webkit-box-shadow: 0px 1px 1px 0px #c12140;
-moz-box-shadow: 0px 1px 1px 0px #c12140;
-o-box-shadow: 0px 1px 1px 0px #c12140;
box-shadow: 0px 1px 1px 0px #c12140;
}
html input[type="button"]:disabled,
.form-submit input[type="submit"]:disabled {
-webkit-transition: all .2s ease-in-out 2s;
-moz-transition: all .2s ease-in-out 2s;
-o-transition: all .2s ease-in-out 2s;
transition: all .2s ease-in-out 2s;
cursor: default;
background-color: #fff;
border: 2px solid #E1E1E1;
color: #BBB;
box-shadow: none;
}
<input value="Download" type="button" onclick="this.disabled=true; this.value='Starting..';location.href='#'">
If you still want the gradient you should look into transition of gradient-position property - check this answer.
I stripped your CSS down a bit.. and then it works.
I don't think the browser likes all the gradient properties, the affect it pretty muted, is it necessary?
input[type="button"] {
margin: 10px 5px 10px 5px;
-webkit-appearance: button;
cursor: pointer;
font-family: Aktiv-Grotesk, Verdana, Geneva, sans-serif;
font-weight: normal;
font-size: 13px;
padding: 9px 15px;
text-transform: uppercase;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
box-shadow: none;
cursor: pointer;
border: 2px solid #ff2e54;
;
-webkit-border-radius: 40px;
border-radius: 40px;
color: #ff2e54;
text-align: center;
-o-text-overflow: clip;
text-overflow: clip;
letter-spacing: 1px;
background: #fff;
transition: 0.3s;
}
input[type="button"]:hover {
background: rgba(255, 45, 84, 1);
border: 2px solid rgba(255, 255, 255, 0);
color: #fff;
-webkit-box-shadow: 0px 2px 7px -1px rgba(255, 45, 85, 0.5);
-moz-box-shadow: 0px 2px 7px -1px rgba(255, 45, 85, 0.5);
-o-box-shadow: 0px 2px 7px -1px rgba(255, 45, 85, 0.5);
box-shadow: 0px 2px 7px -1px rgba(255, 45, 85, 0.5);
}
html input[type="button"]:active {
border: 2px solid #ff607f;
background: #ff607f!important;
color: #eee;
-webkit-box-shadow: 0px 1px 1px 0px #c12140;
-moz-box-shadow: 0px 1px 1px 0px #c12140;
-o-box-shadow: 0px 1px 1px 0px #c12140;
box-shadow: 0px 1px 1px 0px #c12140;
}
html input[type="button"]:disabled,
.form-submit input[type="submit"]:disabled {
-webkit-transition: all .2s ease-in-out 2s;
-moz-transition: all .2s ease-in-out 2s;
-o-transition: all .2s ease-in-out 2s;
transition: all .2s ease-in-out 2s;
cursor: default;
background-color: #fff;
border: 2px solid #E1E1E1;
color: #BBB;
box-shadow: none;
}
You can see it working in this fiddle: https://jsfiddle.net/nvqukp3L/1/
I have a page here:
http://www.simplypsychics.com/psychicprofile.php?pin=4439
and at the bottom I am using buttons. But my site has a standard button style which I use in the following way:
View all our great psychics
The CSS applied to it is this:
.placementtext_button {
background-color: #9a3ba8;
background-image:url(headerbuttons2.jpg);
border-radius:5px;
margin: 10px 10px 10px 10px;
color:#5c5c5a;
font-family:"Century Gothic", sans-serif !important;
font-size:14px !important;
padding:8px !important;
vertical-align: top;
line-height:33px;
text-align:center;
text-decoration:none;
-webkit-text-size-adjust:none;
-webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
-moz-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
}
.placementtext_button:hover {
background-color: #494949;
background-image:url(headerbuttons2.jpg);
border-radius:5px;
margin: 10px 10px 10px 10px;
color:#f8c7ff;
font-family:"Century Gothic", sans-serif !important;
font-size:14px !important;
padding:8px !important;
vertical-align: top;
line-height:33px;
text-align:center;
text-decoration:none;
-webkit-text-size-adjust:none;
-webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
-moz-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
}
but my PHP buttons look completely different. See this image to explain:
http://i61.tinypic.com/102jck1.jpg
and I tried to modify the CSS to appear the same but it isn't working.
Does anyone know where I am going wrong?
This is the CSS for the button:
form input[type="submit"] {
background-color: #9a3ba8;
border-radius: 5px;
margin: 10px 10px 10px 10px;
color: #5c5c5a;
font-family: "Century Gothic", CenturyGothic, AppleGothic, 'Muli', sans-serif !important;
font-size: 14px !important;
padding: 8px !important;
vertical-align: top;
line-height: 33px;
text-align: center;
text-decoration: none !important;
-webkit-text-size-adjust: none;
-webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
-moz-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
}
Try this:
form input[type="submit"] {
background-color: #9a3ba8;
border-radius: 5px;
margin: 10px 10px 10px 10px;
font-family: "Century Gothic", CenturyGothic, AppleGothic, 'Muli', sans-serif !important;
font-size: 14px !important;
padding: 0px !important;
vertical-align: top;
line-height: 33px;
text-align: center;
text-decoration: none !important;
-webkit-text-size-adjust: none;
-webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
-moz-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
letter-spacing: -1px;
font-weight: bold;
color: #ffffff;
border: none;
}
ssergei's on the right track. The key, in this case, is border: none;.
This could also all be consolidated a lot more; there's no need to repeat styles that aren't changing during a hover state. And, if possible, it's best to style similarly styled selectors together (separated by commas) to keep your code cleaner and smaller.
.placementtext_button,
form input[type="submit"] {
background-color: #9a3ba8;
border-radius: 5px;
border: none;
margin: 10px 10px 10px 10px;
color: #ffffff;
font-family: "Century Gothic", CenturyGothic, AppleGothic, 'Muli', sans-serif !important;
font-size: 14px !important;
padding: 8px !important;
vertical-align: top;
line-height: 33px;
text-align: center;
text-decoration: none !important;
-webkit-text-size-adjust: none;
-webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
-moz-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18);
}
.placementtext_button:hover,
form input[type="submit"]:hover {
background-color: #494949;
color:#f8c7ff;
}
My divs keep shifting when I resize the page can someone help me with this?
html/php (php for login and page getter)
my html body part with some php for login in and something with the page
<div class="menu">
<img src="logo.png" style=" position: relative; margin-right: 38%">
<ul class="dropdown">
<li><a href="?page=Home" <?php if ($page == 'Home') { ?> id="a-active" <?php } ?> >Home</a>
<ul class="sub_menu">
<li>News</li>
<li>Servers</li>
</ul>
</li>
<li><a href="?page=Forum" <?php if ($page == 'Forum') { ?> id="a-active" <?php } ?> >Forum</a>
<ul class="sub_menu">
<li>Common</li>
<li>Information</li>
<li>Griefs & Player reports</li>
<li>
Unbans
</li>
</ul>
</li>
<li><a href="?page=Information" <?php if ($page == 'Information') { ?> id="a-active" <?php } ?> >Information</a>
<ul class="sub_menu">
<li>
Rules
</li>
<li>
Staff
</li>
<li>
Servers
<ul>
<li>Survival</li>
<li>Games</li>
</ul>
</li>
</ul>
</li>
<li><a href="?page=Topscores" <?php if ($page == 'Topscores') { ?> id="a-active" <?php } ?> > Topscores</a>
<ul class="sub_menu">
<li>Playtime</li>
<li>Kills</li>
<li>Game wins</li>
</ul>
</li>
<li><a href="?page=Donations" <?php if ($page == 'Donations') { ?> id="a-active" <?php } ?> >Donation</a>
</li>
</ul>
<div class="content">
<?php
if ($page == 'Forum') {
include 'forum/index.html';
} elseif ($page == 'Information') {
include 'information/index.html';
} elseif ($page == 'Topscores') {
include 'topscores/index.html';
} elseif ($page == 'Donations') {
include 'donations/index.html';
} elseif ($page == 'Home') {
include 'home/index.html';
} else {
include '404/index.html';
}
?>
</div>
<div class="contentmirror1">
<?php
if (isset($_SESSION['username'])) {
?>
<form width="110px" id="form1" name="form1" method="post" action="logout.php">
<table width="100px" border="0" align="center">
<tr>
<td colspan="2">Welcome</td>
</tr>
<tr>
<td><input readonly type="text" name="name" style="border:none; background-color: transparent;" value="<?php echo htmlspecialchars($_SESSION['username']); ?>"></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="button" id="button" value="Logout" /></td>
</tr>
</table>
</form>
<?php
} else {
?>
<form width="110px" id="form1" name="form1" method="post" action="login.php">
<table width="100px" border="0" align="center">
<tr>
<td colspan="2">Login</td>
</tr>
<tr>
<td>Username:</td>
<td><input type="text" name="username" id="username" /></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="password" id="password" /></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="button" id="button" value="Login" /></td>
</tr>
</table>
</form>
<?php
}
?>
</div>
<div class="contentmirror" style="Clear: Both;">
spambox/online shizzle
</div>
</div>
my css
.head{
height: 115px;
width: 100%;
position: absolute;
top: 0px;
left: 0px;
background: rgb(200,200,200);
z-index: -999;
}
html {
background: url('background.jpg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.menu{
display: inline-block;
position: absolute;
padding: 2%;
text-align: center;
width: 86%;
left: 0px;
top: 0px;
font-family: arial;
z-index: 0;
}
.menu::after {
padding-top: 56.25%; /* percentage of containing block _width_ */
display: block;
content: '';
}
.content{
float: left;
margin-top: 5%;
width: 60%;
max-width: 60%;
padding: 1%;
background-color: #f5f5f5;
border: 1px solid #e3e3e3;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
}
.contentmirror{
float: right;
margin-top: -3%;
margin-right: 5%;
max-width: 26%;
width: 26%;
padding: 1%;
background-color: #f5f5f5;
border: 1px solid #e3e3e3;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
}
.contentmirror1{
float: right;
margin-top: -25%;
margin-right: 8%;
max-width: 26%;
width: 26%;
padding: 1%;
background-color: #f5f5f5;
border: 1px solid #e3e3e3;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
}
.sidepanelright{
float: right;
}
.main{
text-align: center;
font-family: arial;
font-size: 24px;
}
.pics {
width: 70%;
max-height: 100%;
margin: 0px auto;
}
.pic {
display: none;
background-color: transparent;
border: none;
width: 100%;
max-height: 100%;
}
.menu a{
color: black;
background-color: white;
padding: 5px 10px;
margin: 0px 5px;
border-radius: 10px;
text-decoration: none;
-moz-box-shadow: 0px 0px 20px 0px #4E4E4E;
-webkit-box-shadow: 0px 0px 20px 0px #4E4E4E;
box-shadow: 0px 0px 20px 0px #4E4E4E;
z-index: 0;
}
.menu a:hover{
padding: 7px 12px;
-moz-box-shadow: 0px 0px 30px 0px white;
-webkit-box-shadow: 0px 0px 30px 0px white;
box-shadow: 0px 0px 30px 0px white;
}
#logo{
float: left;
top: -90px;
position: relative;
margin: 5px 0px 0px 5px;
width: 15%;
max-height: 100%;
z-index: 1;
}
.btn:hover, .btn:focus {
color: #333333;
text-decoration: none;
background-position: 0 -15px;
-webkit-transition: background-position 0.1s linear;
-moz-transition: background-position 0.1s linear;
-o-transition: background-position 0.1s linear;
transition: background-position 0.1s linear;
}
.btn:hover, .btn:focus, .btn:active, .btn.active, .btn.disabled, .btn[disabled] {
color: #333333;
background-color: #e6e6e6;
}
.btn {
display: inline-block;
padding: 4px 12px;
margin-bottom: 0;
font-size: 14px;
line-height: 20px;
color: #333333;
text-align: center;
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
vertical-align: middle;
cursor: pointer;
background-color: #f5f5f5;
background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
background-repeat: repeat-x;
border: 1px solid #cccccc;
border-color: #e6e6e6 #e6e6e6 #bfbfbf;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
border-bottom-color: #b3b3b3;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
}
#btn {
display: inline-block;
padding: 4px 12px;
margin-bottom: 0;
font-size: 14px;
line-height: 20px;
color: #333333;
text-align: center;
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
vertical-align: middle;
cursor: pointer;
background-color: #f5f5f5;
background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
background-repeat: repeat-x;
border: 1px solid #cccccc;
border-color: #e6e6e6 #e6e6e6 #bfbfbf;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
border-bottom-color: #b3b3b3;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
}
#btn:hover, #btn:focus, #btn:active, #btn.active, #btn.disabled, #btn[disabled] {
color: #333333;
background-color: #e6e6e6;
}
#btn:hover, #btn:focus {
color: #333333;
text-decoration: none;
background-position: 0 -15px;
-webkit-transition: background-position 0.1s linear;
-moz-transition: background-position 0.1s linear;
-o-transition: background-position 0.1s linear;
transition: background-position 0.1s linear;
}
#a-active{
color: black;
background-color: #DDDDDD;
padding: 5px 10px;
margin: 0px 5px;
border-radius: 10px;
text-decoration: none;
-moz-box-shadow: 0px 0px 20px 0px #4E4E4E;
-webkit-box-shadow: 0px 0px 20px 0px #4E4E4E;
box-shadow: 0px 0px 20px 0px #4E4E4E;
z-index: 0;
}
#a-active:hover{
background-color: white;
padding: 7px 12px;
-moz-box-shadow: 0px 0px 30px 0px white;
-webkit-box-shadow: 0px 0px 30px 0px white;
box-shadow: 0px 0px 30px 0px white;
}
* { margin: 0; padding: 0; }
body { font: 14px Helvetica, Sans-Serif; }
#page-wrap { width: 800px; margin: 25px auto; }
a { text-decoration: none; }
ul { list-style: none;}
p { margin: 15px 0; }
/*
LEVEL ONE
*/
.drops{
margin-left: 30%;
}
ul.dropdown { position: relative; margin-left: 37%; margin-top: 2%;}
ul.dropdown li { font-weight: bold; float: left; zoom: 1; }
ul.dropdown a:hover { }
ul.dropdown a:active { }
ul.dropdown li a { display: block; padding: 4px 8px; border-right: 1px solid #333;
}
ul.dropdown li:last-child a { border-right: none; } /* Doesn't work in IE */
ul.dropdown li.hover,
ul.dropdown li:hover { color: black; position: relative; }
ul.dropdown li.hover a { color: black; }
/*
LEVEL TWO
*/
ul.dropdown ul { width: 220px; visibility: hidden; position: absolute; top: 100%; left: 0; }
ul.dropdown ul li { font-weight: normal; float: none; }
/* IE 6 & 7 Needs Inline Block */
ul.dropdown ul li a { border-right: none; width: 100%; display: inline-block; }
/*
LEVEL THREE
*/
ul.dropdown ul ul { left: 100%; top: 0; }
ul.dropdown li:hover > ul { visibility: visible; }
when I resize the window the divs shifts to the left or down. is there a way to set those divs on one position where they do not shift positions just stay there?
I pretty much didn't understand your code, but made this fiddle to make you understand how to fix the divs.
I would suggest you to avoid float for divs and do something like:
.fix{
/* this is parent div */
display:inline-block ;
white-space:nowrap;
}
.fxchld{
/* these are child divs */
width:50px;
display:inline-block ;
height:50px;
border:1px solid #000;
}
idea is to use display:inline-block ; instead of floats so that they remain fixed to their position
else
you'll have to give large parent div width so that child divs won't wrap
Fiddle will help you understand my point!!
My navigation of my website acts strange 2 buttons go out of the div and i cant find the reason for this.
the thing i want is that the 2 blue buttons are on the right of the div but if i float them they still stay out of the div.
image:
HTML:
<div id="navigation">
<ul>
<li>Home</li>
<li>plaats advertentie</li>
<li>Advertenties</li>
</ul>
<ul>
<?php
session_start();
echo '<div id="login">';
if(isset($_SESSION['username'])){
echo'<li>Profile</li>
<li>Logout</li>';
}else{
echo'<li>Register</li>';
echo'<li>Login</li>';
}
echo '</div>';
?>
</ul>
</div>
CSS:
#navigation{
border:1px solid;
border-radius: 2px;
height:50px;
margin-top:1%;
margin-bottom:1%;
background:#6F4E37;
border-radius:8px;
}
#navigation ul
{
margin: 0;
padding-top:1%;
border:1px solid;
}
#navigation ul li
{
display: inline;
}
#navigation li a
{
padding:10px;
margin:0.5%;
background: #6F4E37;
color:black;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
border: solid 1px #20538D;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
-webkit-transition-duration: 0.2s;
-moz-transition-duration: 0.2s;
transition-duration: 0.2s;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
text-decoration: none;
}
#login li a
{
background:#b2fff1;
padding:10px;
margin:0.5%;
background:#b2fff1;
color:black;
text-decoration: none;
}
#navigation li a:hover {
background: #805a3f;
border: solid 1px #2A4E77;
text-decoration:underline;
}
#login li a:hover
{
background:#4cffdf;
border: solid 1px #2A4E77;
text-decoration:underline;
}
<?php
session_start();
echo '<div id="login">';
if(isset($_SESSION['username'])){
echo'<li>Profile</li>
<li>Logout</li>';
}else{
echo'<li>Register</li>';
echo'<li>Login</li>';
}
echo '</div>';
?>
Then change your CSS:
#navigation {
border:1px solid;
border-radius: 2px;
height:50px;
margin-top:1%;
margin-bottom:1%;
background:#6F4E37;
border-radius:8px;
}
#navigation ul {
margin: 0;
padding-top:1%;
border:1px solid;
}
#navigation ul li {
display: inline;
}
#navigation li a {
padding:10px;
margin:0.5%;
background: #6F4E37;
color:black;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
border: solid 1px #20538D;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
-webkit-transition-duration: 0.2s;
-moz-transition-duration: 0.2s;
transition-duration: 0.2s;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
text-decoration: none;
}
#login {
float:right;
}
#login li {
float:left;
padding-left:10px;
}
#login li a {
background:#b2fff1;
padding:10px;
margin:0.5%;
background:#b2fff1;
color:black;
text-decoration: none;
}
#navigation li a:hover {
background: #805a3f;
border: solid 1px #2A4E77;
text-decoration:underline;
}
#login li a:hover {
background:#4cffdf;
border: solid 1px #2A4E77;
text-decoration:underline;
}
Fiddle Here
First:
white-space is your friend. Don't glue everything in the PHP together.
Second:
It is not allowed to use div immediately as the child of the ul element. If you need to add an id attribute, add it to the ul
<ul id="login">
<?php
session_start();
if (isset($_SESSION['username'])) {
echo '<li>Profile</li>'.
'<li>Logout</li>';
} else {
echo '<li>Register</li>';
echo '<li>Login</li>';
}
?>
</ul>
Third:
Switch the uls places and float the one with id="login" to the right:
<ul id="login">
<?php
session_start();
if (isset($_SESSION['username'])) {
echo '<li>Profile</li>'.
'<li>Logout</li>';
} else {
echo '<li>Register</li>';
echo '<li>Login</li>';
}
?>
</ul>
<ul>
<li>Home</li>
<li>plaats advertentie</li>
<li>Advertenties</li>
</ul>
CSS:
#login {
float: right;
}
Updated answer:
HTML
<div id="navigation">
<ul class="leftnav">
<li>Home</li>
<li>plaats advertentie</li>
<li>Advertenties</li>
</ul>
<ul class="rightnav">
<?php
session_start();
echo '<div id="login">';
if(isset($_SESSION['username'])){
echo'<li>Profile</li>
<li>Logout</li>';
}else{
echo'<li>Register</li>';
echo'<li>Login</li>';
}
echo '</div>';
?>
</ul>
CSS
#navigation{
border:1px solid;
border-radius: 2px;
height:50px;
margin-top:1%;
margin-bottom:1%;
background:#6F4E37;
border-radius:8px;
}
#navigation ul
{
margin: 0;
padding-top:1%;
border:1px solid;
}
#navigation ul.leftnav {
float: left;
}
#navigation ul.rightnav {
float: right;
}
#navigation ul li
{
display: inline;
}
#navigation li a
{
padding:10px;
margin:0.5%;
background: #6F4E37;
color:black;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
border: solid 1px #20538D;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
-webkit-transition-duration: 0.2s;
-moz-transition-duration: 0.2s;
transition-duration: 0.2s;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
text-decoration: none;
}
#login li a
{
background:#b2fff1;
padding:10px;
margin:0.5%;
background:#b2fff1;
color:black;
text-decoration: none;
}
#navigation li a:hover {
background: #805a3f;
border: solid 1px #2A4E77;
text-decoration:underline;
}
#login li a:hover
{
background:#4cffdf;
border: solid 1px #2A4E77;
text-decoration:underline;
}
In my php below i have a forgot password thing and it echo's a form depending on certain conditions how would i style this with my css? because i do not want the forms showing up without any styling
I have tried and tried to figure out what to do but there has been nothing. i even tried thinking about making this into a few serate pages but got confused and lost
<?php
require("core/dbc.php");
if(isset($_GET['code']))
{
$get_username = $_GET['username'];
$get_code = $_GET['code'];
$query = mysql_query("SELECT * FROM users WHERE username='$get_username'");
while($row = mysql_fetch_assoc($query))
{
$db_code = $row['passreset'];
$db_username = $row['username'];
}
if($get_username == $db_username && $get_code == $db_code)
{
echo "
<form action='pass_reset_complete.php?code=$get_code' method='POST'>
Enter A New Password<br><input type='password' name='newpass'><br>
Re-Enter Your New Password<br><input type='password' name='newpass1'><p>
<input type='hidden' name='username' value='$db_username'>
<input type='submit' value='Update Password'>
</form>
";
}
}
if(!isset($_GET['code']))
{
echo "
<form action='forgot_pass.php' method='POST'>
Enter Your Username<br><input type='text' name='username'><p>
Enter your email<br><input type='text' name='email'><p>
<input type='submit' value='Submit' name='submit'>
</form>
";
if(isset($_POST['submit']))
{
$username = $_POST['username'];
$email = $_POST['email'];
$query = mysql_query("SELECT * FROM users WHERE username='$username'");
$numrow = mysql_num_rows($query);
if($numrow!=0)
{
while($row = mysql_fetch_assoc($query))
{
$db_email = $row['email'];
}
if($email == $db_email)
{
$code = rand(10000,1000000);
$to = $db_email;
$subject = "Password Reset";
$body = "
This is a automated email. PLEASE DO NOT REPLY TO THIS MESSAGE
Click the link below or paste it into your browser
http://localhost:8080/signup-project/signup-project/registration%20and%20login/forgot_pass.php?code=$code&username=$username
";
mysql_query("UPDATE users SET passreset='$code' WHERE username='$username'");
mail($to,$subject,$body);
echo "Check Your Email For Your New Password";
}
else
{
echo "the email is incorrect";
}
}
else
{
echo "that username does not exist";
}
}
}
?>
Ok i am confused because a lot of people are saying different ways so let me try this i am going to put my css file code then i am going to paste my log in form code (where i have this css working'
this is the code from my .css file
body {
line-height: 1.4;
background-color: #666;
font-family: Arial, Helvetica, sans-serif;
}
h1 {
font-family: 'Roboto', sans-serif;
}
.hidden {
display: none;
}
a,
a:active,
a:focus
a:visited {
color: #1B9BE0 ;
text-decoration: none;
}
a:hover {
text-decoration: underline
}
/* Structure */
#wrap {
width: 960px;
margin: 0 auto;
padding: 20px;
background-color: #fff;
-webkit-box-shadow: 1px 1px 5px rgba(50, 50, 50, 0.75);
-moz-box-shadow: 1px 1px 5px rgba(50, 50, 50, 0.75);
box-shadow: 1px 1px 5px rgba(50, 50, 50, 0.75);
}
#head {
text-align: center;
}
.form-wrap {
width: 600px;
margin: 0 auto;
}
.content {
overflow: hidden;
}
.user-controls {
float: right;
}
.logged-in-user{
float: right;
margin-left: 140px;
}
.logged-in-user p {
margin: 0;
}
/* Form Elements */
fieldset {
border: 0;
padding: 0;
}
.form-el {
margin: 10px 0;
}
.btn {
display: inline-block;
padding: 4px 12px;
margin-bottom: 0;
font-size: 14px;
line-height: 20px;
color: #333333;
text-align: center;
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
vertical-align: middle;
cursor: pointer;
background-color: #f5f5f5;
background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
background-repeat: repeat-x;
border: 1px solid #cccccc;
border-color: #e6e6e6 #e6e6e6 #bfbfbf;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
border-bottom-color: #b3b3b3;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
}
input[type="text"],
input[type="number"],
input[type="password"],
textarea {
background-color: #fff;
border: 1px solid #ccc;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-webkit-transition: border linear .2s,box-shadow linear .2s;
-moz-transition: border linear .2s,box-shadow linear .2s;
-o-transition: border linear .2s,box-shadow linear .2s;
transition: border linear .2s,box-shadow linear .2s;
padding: 8px 4px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
width: 270px;
font-size: 18px;
}
input[type="text"]:hover,
input[type="number"] :hover,
input[type="password"]:hover {
border-color: rgba(82, 168, 236, 0.8);
outline: 0;
outline: thin dotted 9;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
}
input[type="submit"] {
color: #ffffff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #006dcc;
background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
background-image: -o-linear-gradient(top, #0088cc, #0044cc);
background-image: linear-gradient(to bottom, #0088cc, #0044cc);
background-repeat: repeat-x;
border-color: #0044cc #0044cc #002a80;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
}
Now this is my login form that has the css on it
<html>
<head>
<meta charset="utf-8">
<title>Log-In</title>
<link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'/>
<link href="../css/core.css" rel="stylesheet" />
</head>
<body>
<div id="wrap">
<div id="head">
<h1>Login to the Assignment Upload System</h1>
</div>
<div class="content">
<form action="core/authenticate.php" method="POST">
<div class="form-wrap">
<fieldset>
<legend class="hidden">Login</legend>
<div class="form-el">
<label class="hidden" for="username">User name</label>
<input id="username" type="text" name="username" placeholder="Enter Your Username..."><br />
</div>
<div class="form-el">
<label class="hidden" for="password">Password</label>
<input id="password" type="password" name="password" placeholder="Enter Your Password..."><br />
Forgot Password?
</div>
<input class="btn" type="submit" value="Login">
</fieldset>
</div>
</form>
</div>
<?php if(isset($_GET["feedback"])){echo $_GET["feedback"];} ?>
</div>
</body>
</html>
Now i want my echo form in my php to look exactly like this page so how would i do this? because i am getting really confused with what people are saying
an easy way is to include bootstrap:
include this in the <head>
<link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" media="screen" />
then in all your inputs add class="form-control"
for example:
<input type="text" class="form-control" />
Just make sure you include your CSS file in the HTML file you are generating with your PHP Code.
<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
give the form a class name like this:
echo "
<form action='pass_reset_complete.php?code=$get_code' method='POST' class='first_form'>
Enter A New Password...etc
then add style tag but out of the PHP codes:
<style>
.first_form{
background:#ccc;
width:300px;
border:solid #000 1px;
}
</style>
and you can styling input tags in the form like this:
<style>
.first_form{
background:#ccc;
width:300px;
border:solid #000 1px;
}
.first_form > input[type=password]{
width:250px;
color:#fff;
background:#333;
}
.first_form > input[type=submit]{
width:70px;
border:none;
}
</style>