CSS Z-index, drop down arrow floating above main menu - css

I have two separate collapsible menu scripts I've implemented onto my website. With the second menu, a collapsible information display that has a arrow that rotates when the information menu is open, the arrow itself floats above everything else, even when the main drop down menu covers it. I have messed with the z-index of both items but can not figure out how to fix it. I have attached the relative code as well as photos of the problem area.
THIS IS MY CSS FOR MY MAIN HAMBURGER MENU AND THE BUTTON IN THE TOP LEFT CORNER
/* [ON BIG SCREENS] */
/* (A) WRAPPER */
#hamnav {
width: 100%;
background: #333333;
/* Optional */
top: 0;
position: fixed;
border-bottom: 1px solid #999999;
}
/* (B) HORIZONTAL MENU ITEMS */
#hamitems { display: flex;
z-index:100;
}
#hamitems a {
flex-grow: 1;
flex-basis: 0;
padding: 5px;
color: #D5DBDB;
text-decoration: none;
text-align: center;
font-size: 12px;
line-height: 20px;
border-left: 1px solid #999999;
border-right: 1px solid #999999;
border-bottom: 1px solid #666666;
font-family; Verdana;
z-index:100;
}
#hamitems a:hover {
background: #999999;
color: #D5DBDB;
}
/* (C) HIDE HAMBURGER */
#hamnav label, #hamburger { display: none; }
/* [ON SMALL SCREENS] */
#media screen and (max-width: 768px){
/* (A) BREAK INTO VERTICAL MENU */
#hamitems a {
box-sizing: border-box;
display: block;
width: 100%;
border-top: 1px solid #999999;
font-family: Verdana;
z-index:100;
}
/* (B) SHOW HAMBURGER ICON */
#hamnav label {
display: inline-block;
color: #FFFFFF;
background: #333333;
font-style: normal;
font-size: 2.0em;
padding: 5px;
padding-left: 12px;
}
/* (C) TOGGLE SHOW/HIDE MENU */
#hamitems { display: none; }
#hamnav input:checked ~ #hamitems { display: block; }
}
/* [DOES NOT MATTER] */
html, body {
padding: 0;
margin: 0;
color: #FFFFFF;
background-color: #000000;
bgcolor: #000000;
}
THIS IS MY CSS FOR THE COLLAPSIBLE INFORMATION MENU WHICH DISPLAYS THE BULLET ABOVE THE FLOATING MAIN MENU WHEN I DROP IT. NOTHING ELSE FLOATS ABOVE THE MAIN MENUE.
input[type='checkbox'] {
display: none;
}
.wrap-collabsible {
margin: 10px 5px 20px 5px; }
.lbl-toggle {
display: block;
font-weight: bold;
font-family: monospace;
font-size: 1.2rem;
text-transform: uppercase;
text-align: center;
padding: 1rem;
color: #DDD;
background: #000000;
cursor: pointer;
border-radius: 7px;
transition:
all 0.25s ease-out;
}
.lbl-toggle:hover {
color: #FFF;
}
.lbl-toggle::before {
content: ' ';
display: inline-block;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid currentColor;
vertical-align: middle;
margin-right: .7rem;
transform: translateY(-2px);
transition: transform .2s ease-out;
}
.toggle:checked+.lbl-toggle::before {
transform: rotate(90deg) translateX(-3px);
}
.collapsible-content {
max-height: 0px;
overflow: hidden;
transition: max-height .25s ease-in-out;
}
.toggle:checked + .lbl-toggle + .collapsible-content {
max-height: 5000px;
}
.toggle:checked+.lbl-toggle {
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.collapsible-content .content-inner {
background: #000000;
border-bottom: 1px solid #FFFFFF;
border-bottom-left-radius: 7px;
border-bottom-right-radius: 7px;
padding: .5rem 1rem;
}
.collapsible-content p {
margin-bottom: 0;
font-size: 15px;
font-family: Verdana;
margin-left: auto;
margin-right: auto;
text-align: justify;
line-height: 25px;
}
THIS IS THE MARKUP AS REQUESTED, THIS PRINTS THE COLLAPSIBLE INFORMATION MENU WITH THE TROUBLESOME BULLET POINT (CHECKBOX)
if (isset($v) && $v==1){
echo "<div class='wrap-collabsible'>";
echo "<input id='collapsible' class='toggle' type='checkbox'>";
echo "<label for='collapsible' class='lbl-toggle'>Alphabetical name jump</label>";
echo "<div class='collapsible-content'>";
echo "<div class='content-inner'>";
echo "<p>";
$sql = "SELECT user_id, username FROM user_reg ORDER BY username";
$result = mysqli_query($conn, $sql);
while($row = mysqli_fetch_array($result, MYSQLI_NUM))
{
$id=$row[0];
$username=$row[1];
echo "<a href='#$id' class=block>$username</a>";
echo " ";
}
echo "</p>";
echo "</div>";
echo "</div>";
echo "</div>";
} // END IF V1
THIS IS THE HAMBURGER MENU WHICH IS ALLOWING THE TROUBLESOME BULLETPOINT TO BE DISPLAYED ABOVE IT
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body bgcolor="#000000">
<!-- (A) MENU WRAPPER -->
<nav id="hamnav">
<!-- (B) THE HAMBURGER -->
<label for="hamburger">☰</label>
<input type="checkbox" id="hamburger"/>
<!-- (C) MENU ITEMS -->
<div id="hamitems">
<a href=admin_panel.php?v=8>Unoff, Verif & Photo <?php echo "($total8)"; ?></a>
<a href=admin_panel.php>Offic, Verif <?php echo "($total)"; ?></a>
<a href=admin_panel.php?v=7>Unnoff, Verif, No Photo <?php echo "($total7)"; ?></a>
<a href=admin_panel.php?v=2>UnVerif <?php echo "($total2)"; ?></a>
<a href=admin_panel.php?v=1>Active <?php echo "($total1)"; ?></a>
<a href=admin_panel.php?v=3>Blocked <?php echo "($total3)"; ?></a>
<a href=admin_panel.php?v=4>Inactive <?php echo "($total4)"; ?></a>
<a href=admin_panel.php?v=5>Test Account</a>
<a href=admin_panel_orders.php>Orders <?php echo "($total6 new)"; ?></a>
<a href=admin_email_log.php?v=7>Remind Log</a>
<a href=admin_panel_polls.php>Poll #1 Log <?php echo "($total_poll votes)"; ?></a>
<a href=admin_messages.php>Contact Mess <?php echo "($total_mess new)"; ?></a>
<a href=admin_refer_friend_log.php>Refer FRND Log <?php echo "($total_log)"; ?></a>
<a href=admin-edit-store-items.php>Products <?php echo "($total_products out of stock)"; ?></a>
<a href=admin-create-coupon.php>Coupons <?php echo "($total_coup left)"; ?></a>
</div>
</nav>

I solved this issue using style="position: relative; z-index: 0;" for the elements that must appear below other elements. The elements that must appear on top should have z-index: 1;
For details check out the 3rd point in this article!

Related

Header cut off on mobile devices

The header is being cut off on mobile devices, this is causing the top of the logo to be cut off. The issue occurs on this website: http://development.blackcountrydesigns.co.uk
I am building a custom theme for the website. This issue does not appear when inspected in browser tools, only when actually viewing on a mobile device. Tested on an iPhone 6 and Sony Xperia XZ1.
Here is my header.php file:
<!doctype html>
<html>
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1, user-scalable=0'>
<title><?php echo get_bloginfo('name'); ?> | <?php echo get_the_title(); ?></title>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<header>
<div class='bravo-logo'>
<?php if(function_exists('the_custom_logo') && has_custom_logo()) {
the_custom_logo();
} else { ?>
<a href='<?php get_bloginfo('wpurl'); ?>'><?php echo get_bloginfo('name'); ?></a>
<?php } ?>
</div>
<div class='bravo-main-menu bravo-menu'>
<?php wp_nav_menu(array('theme_location' => 'main-menu', 'item-spacing' => 'discard')); ?>
</div>
<div class='bravo-mobile-menu'>
<i class='fas fa-bars fa-2x' id='bravo-hamburger'></i>
</div>
</header>
<div class='bravo-vertical-nav'>
<?php wp_nav_menu(array('theme_location' => 'main-menu', 'item-spacing' => 'discard')); ?>
</div>
Here is all of the relevant CSS for my header - please note there are approximately 600 lines of CSS so I have just stripped the file and only included CSS that is relevant to the site header:
/* Global/General Styles */
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
html,
body {
background-color: #eee;
color: #4d4d4d;
font-family: 'Montserrat', sans-serif;
}
body {
padding-bottom: 270px;
position: relative;
min-height: 100vh;
}
/* Header */
header {
min-height: 150px;
display: flex;
align-items: center;
border-bottom: 3px solid #1abc9c;
background-color: #fff;
}
/* Logo */
div.bravo-logo {
padding: 1rem;
margin-left: 1.5rem;
}
div.bravo-logo img {
height: 100px;
width: auto;
}
#media only screen and (max-width: 450px) {
div.bravo-logo img {
width: 90%;
height: auto;
}
}
div.bravo-logo a {
text-decoration: none;
font-size: 1.5rem;
color: #4d4d4d;
}
/* Menus */
div.bravo-menu ul {
list-style-type: none;
}
div.bravo-menu ul li {
display: inline-block;
}
div.bravo-main-menu {
align-self: flex-end;
width: 100%;
margin-right: 3.5rem;
}
div.bravo-main-menu ul {
float: right;
}
div.bravo-main-menu ul li a {
display: block;
padding: .5rem .75rem;
text-decoration: none;
color: #4d4d4d;
font-size: 1.5rem;
font-weight: 200;
letter-spacing: .15rem;
transition: .3s;
}
div.bravo-main-menu li.current-menu-item a {
font-weight: bold;
}
div.bravo-main-menu ul li a:hover {
background-color: #1abc9c;
color: #fff;
}
div.bravo-mobile-menu {
display: none;
margin-right: 1.75rem;
}
div.bravo-mobile-menu i {
cursor: pointer;
}
div.bravo-vertical-nav {
display: none;
}
div.bravo-vertical-nav ul {
list-style-type: none;
}
div.bravo-vertical-nav ul li {
text-align: center;
cursor: pointer;
padding: .85rem 0;
background-color: #eee;
border-bottom: 2px solid #1abc9c;
}
div.bravo-vertical-nav ul li a {
text-decoration: none;
color: #1abc9c;
font-weight: 600;
font-size: 1.1rem;
letter-spacing: .1rem;
}
#media only screen and (max-width: 1160px) {
header {
justify-content: space-between;
}
div.bravo-main-menu {
display: none;
}
div.bravo-mobile-menu {
display: block;
}
}
#media only screen and (max-width: 1070px) {
body {
padding-bottom: 570px;
}
header {
margin-top: -32px !important;
}
div#wpadminbar {
display: none !important;
}
}
#media only screen and (max-width: 782px) {
header {
margin-top: -46px !important;
}
}
The negative margin top that I've set on two breakpoints is to get rid of the space left when hiding the admin bar - I have tried with and without these values and neither has seemed to make a difference. I have tried adjusting the padding on the header and logo containers, but I'm struggling as I can't seem to replicate the errors within my desktop browser.
Please see below a screenshot of the issue:
It's caused by bravo.css?ver=0.0.1, line 483:
#media only screen and (max-width: 782px) {
header {
margin-top: -46px !important;
}
}
... which overrides the rule set at line 456 (same file):
#media only screen and (max-width: 1070px) {
header {
margin-top: -32px !important;
}
}
You probably want to set a different value for that margin-top. -10px looks like a good candidate.
You are doing something wrong when hiding admin bar, you don't need that negative margin-top, leave it at 0.
Install "remove admin bar" plugin or add add_filter(‘show_admin_bar’, ‘__return_false’); to functions.php for properly hiding it when logged in.

Dealing with flexbox while changing an element

I have a problem with styling my bar, which works on flexbox.
bar
As you can see, there is three divs inside: one sticked to the left border and another sticked to right border; there is also a small div in the middle showing the amount of comments (80px) and I want it to go left and stick to the div on left. Is it a chance to manage this with flexbox, without changing for display: inline-block?
The bar has a class .article__metas.
The div in the middle is .social_item.
<div class="article__metas">
<div class="item date">
//showing date
</div>
<div class="seperator"></div>
<?php
/**
$clist = get_the_category_list(', ');
if (!empty($clist)) {
?>
<div class="item categories">
<?php
echo $clist;
?>
</div>
<div class="seperator separator-categories"></div>
<?php } */
?>
<?php
$share = $app->getPostStats();
if ($share->comment_count > 0 || $share->share_count > 0):?>
<div class="item social_item">
<?php
if ($share->comment_count > 0) {
echo '<span>';
echo '<img src="' . _img_url('comment.svg') . '"/>';
echo '<span class="amount">' . $share->comment_count . '</span>';
echo '</span>';
}
if ($share->share_count > 0) {
echo '<span>';
echo '<img src="' . _img_url('share.svg') . '"/>';
echo '<span class="amount">' . $share->share_count . '</span>';
echo '</span>';
}
?>
</div>
<?php endif; ?>
<?php get_template_part('inc/article/share'); ?>
</div>
And Sass:
.article__metas {
color: #888888;
font-size: 12px;
display: flex;
border-bottom: 1px solid #e5e5e5;
justify-content: space-between;
#include link-color('a', '#888');
a:hover {
text-decoration: underline;
}
.item {
padding: 20px;
&:first-child {
padding-left: $cards_left;
}
}
.seperator {
display: block;
align-self: stretch;
width: 1px;
background-color: #e5e5e5;
}
.social_item {
display: flex;
align-items: center;
justify-content: space-between;
span + span {
margin-left: 20px;
}
& > span {
display: block;
white-space: nowrap;
img {
width: 16px;
display: inline-block;
}
}
img {
margin-top: 2px;
margin-right: 9px;
}
}
}
Thank you in advance!
Please check if this is what you need. SCSS doesn't work here, so you need to copy to your own environment.
.ariticle__metas is now aligned left and .social_item has a margin-left:auto
Fiddle here
.article__metas {
color: #888888;
font-size: 12px;
display: flex;
border-bottom: 1px solid #e5e5e5;
justify-content: left;
#include link-color('a', '#888');
a:hover {
text-decoration: underline;
}
.item {
padding: 20px;
&:first-child {
padding-left: 10px;
}
}
.seperator {
display: block;
align-self: stretch;
width: 1px;
background-color: #e5e5e5;
}
.social_item {
display: flex;
align-items: center;
justify-content: space-between;
margin-left: auto;
span + span {
margin-left: 20px;
}
& > span {
display: block;
white-space: nowrap;
margin-right: 10px;
img {
width: 16px;
display: inline-block;
}
}
img {
margin-top: 2px;
margin-right: 9px;
}
}
}
<div class="article__metas">
<div class="item">Dodano 18.04.2016</div>
<div class="seperator"></div>
<div class="item">1</div>
<div class="seperator"></div>
<div class="social_item">
<span>Spodobal Ci</span>
<img src="http://placehold.it/15" />
<img src="http://placehold.it/15" />
<img src="http://placehold.it/15" />
<img src="http://placehold.it/15" />
</div>
</div>

CSS - White box surrounding area

HTML & PHP:
function edds_credit_card_form( $echo = true ) {
global $edd_options;
if( edd_get_option( 'stripe_checkout', false ) ) {
return;
}
ob_start(); ?>
<?php if ( ! wp_script_is ( 'stripe-js' ) ) : ?>
<?php edd_stripe_js( true ); ?>
<?php endif; ?>
<?php do_action( 'edd_before_cc_fields' ); ?>
<fieldset id="edd_cc_fields" class="edd-do-validate">
<legend><?php _e( 'Credit Card Info', 'edds' ); ?></legend>
<?php if( is_ssl() ) : ?>
<div id="edd_secure_site_wrapper">
<span class="padlock"></span>
<span><?php _e( 'This is a secure SSL encrypted payment.', 'edds' ); ?></span>
</div>
<?php endif; ?>
<p id="edd-card-number-wrap">
<label for="card_number" class="edd-label">
<?php _e( 'Card Number', 'edds' ); ?>
<span class="edd-required-indicator">*</span>
<span class="card-type"></span>
</label>
<span class="edd-description"><?php _e( 'The (typically) 16 digits on the front of your credit card.', 'edds' ); ?></span>
<input type="tel" pattern="[0-9]{13,16}" autocomplete="off" id="card_number" class="card-number edd-input required" placeholder="<?php _e( 'Card number', 'edds' ); ?>" />
</p>
<p id="edd-card-cvc-wrap">
<label for="card_cvc" class="edd-label">
<?php _e( 'CVC', 'edds' ); ?>
<span class="edd-required-indicator">*</span>
</label>
<span class="edd-description"><?php _e( 'The 3 digit (back) or 4 digit (front) value on your card.', 'edds' ); ?></span>
<input type="tel" pattern="[0-9]{3,4}" size="4" autocomplete="off" id="card_cvc" class="card-cvc edd-input required" placeholder="<?php _e( 'Security code', 'edds' ); ?>" />
</p>
<p id="edd-card-name-wrap">
<label for="card_name" class="edd-label">
<?php _e( 'Name on the Card', 'edds' ); ?>
<span class="edd-required-indicator">*</span>
</label>
<span class="edd-description"><?php _e( 'The name printed on the front of your credit card.', 'edds' ); ?></span>
<input type="text" autocomplete="off" id="card_name" class="card-name edd-input required" placeholder="<?php _e( 'Card name', 'edds' ); ?>" />
</p>
<?php do_action( 'edd_before_cc_expiration' ); ?>
<p class="card-expiration">
<label for="card_exp_month" class="edd-label">
<?php _e( 'Expiration (MM/YY)', 'edds' ); ?>
<span class="edd-required-indicator">*</span>
</label>
<span class="edd-description"><?php _e( 'The date your credit card expires, typically on the front of the card.', 'edds' ); ?></span>
<select id="card_exp_month" class="card-expiry-month edd-select edd-select-small required">
<?php for( $i = 1; $i <= 12; $i++ ) { echo '<option value="' . $i . '">' . sprintf ('%02d', $i ) . '</option>'; } ?>
</select>
<span class="exp-divider"> / </span>
<select id="card_exp_year" class="card-expiry-year edd-select edd-select-small required">
<?php for( $i = date('Y'); $i <= date('Y') + 30; $i++ ) { echo '<option value="' . $i . '">' . substr( $i, 2 ) . '</option>'; } ?>
</select>
</p>
<?php do_action( 'edd_after_cc_expiration' ); ?>
</fieldset>
<?php
do_action( 'edd_after_cc_fields' );
$form = ob_get_clean();
if ( false !== $echo ) {
echo $form;
}
return $form;
}
add_action( 'edd_stripe_cc_form', 'edds_credit_card_form' );
CSS:
/*
/* Remove Page Header */
.page-id-1974 .leftside h1 {
display: none;
}
/* Remove Page Header */
.page-id-1974 .leftside h1 {
display: none;
}
/* Remove Content Box Padding */
.page-id-1974 .leftside {
padding: 0;
width: 620px;
}
/* Change Beat Store Height */
.page-id-1974 .mejs-playlist {
height: 600px !important;
margin-bottom: 0;
}
/* Top Header Color Black/Transparent */
.navigation_holder, .header_holder {
background-color: rgba(0,0,0,0.85);
}
/* Widget text and line colors */
.widget h3 {
/* color: #FFAE00; */
color: #FFFFFF;
}
.widget h3 {
font-size: 15px;
font-weight: bold;
/* color: #FFAE00; */
color: #FFFFFF;
width: 270px;
border-bottom-width: 3px;
border-bottom-style: double;
float: left;
border-bottom-color: #b50707;
padding-bottom: 5px;
margin-bottom: 10px;
}
/* Widget backround black/transparent */
.widget {
line-height: 20px;
font-size: 14px;
color: #ffffff;
/***** "color: " this changes beat buying steps color***********/
background-color: rgba(0,0,0,0.86);
float: left;
width: 270px;
margin-bottom: 15px;
box-shadow: 2px 1px 3px rgba(0,0,0,0.10);
-moz-box-shadow: 2px 1px 3px rgba(0,0,0,0.10);
-webkit-box-shadow: 2px 1px 3px rgba(0,0,0,0.10);
padding: 15px;
}
/* Main backround black/transparent */
#main {
margin-left: 10px;
background-color: rgba(0,0,0,0.83);
float: left;
box-shadow: 0 0 3px 1px rgba(0,0,0,0.10);
-moz-box-shadow: 0 0 3px 1px rgba(0,0,0,0.10);
-webkit-box-shadow: 0 0 3px 1px rgba(0,0,0,0.10);
}
/* Main BeatStore backround black/transparent */
element.style {
top: 30px;
width: 100%;
height: 30px;
}
.page-id-14 .mejs-playlist {
height: 600px !important;
margin-bottom: 0;
}
.mejs-playlist {
height: 650px !important;
/* color: #FFAE00; */
color: #FFFFFF;
margin-bottom: 15px;
clear: both;
display: block;
float: left;
overflow-y: auto;
margin-top: 30px;
background: rgba(0,0,0,0.7);
}
/* Main BeatStore Orange Highlights and red lines */
element.style {
}
#main li {
padding-bottom: 8px;
line-height: 19px;
}
.button, .widget .edd_checkout, .mejs-controls
.mejstime-rail.mejs-time-loaded, a.edd-submit, li.cat-item:hover,
.tagcloud
a:hover, .mejs-playlist li.current, .mejs-playlist li:hover,
#primary_nav_wrap ulli:hover {
background-color: #ff7600 !important;
}
.mejs-playlist li:hover, .mejs-playlist li:hover span.genre,
.mejs- playlist li:hover .pltext, .mejs-playlist li:hover .fa {
color: #ffffff;
/*background-color: #0087bf;*/
}
.mejs-playlist li.current {
color: #ffffff;
}
.mejs-playlist li {
color: white;
overflow: hidden;
font-size: 16px;
list-style-type: none;
padding: 15px;
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #f50303;
min-height: 46px;
}
/*Content Header Colors*/
h1#content_header {
font-size: 33px;
font-weight: bold;
color: #ffae00;
border-bottom-width: 3px;
border-bottom-style: double;
border-bottom-color: #b50707;
padding-bottom: 15px;
margin-bottom: 15px;
}
element.style {
}
#main h1, #main h2, #main h3, #main h4, #main h5, #main h6 {
clear: both;
}
h1, h2, h3, h4, h5, h6, #content_header, .button, .widget .edd_checkout {
font-family: 'PT Sans';
}
h2 {
font-size: 30px;
line-height: 30px;
}
h1, h2, h3, h4, h5, h6 {
padding-bottom: 10px;
line-height: normal;
display: block;
/* color: #FFAE00; */
color: #FFFFFF;
font-weight: bold;
}
element.style {
}
#main li {
padding-bottom: 8px;
line-height: 19px;
}
#main li {
padding-bottom: 8px;
line-height: 19px;
}
.mejs-playlist li {
color: #fff;
overflow: hidden;
font-size: 16px;
list-style-type: none;
padding: 15px;
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #f50303;
min-height: 46px;
}
/* FROM HERE DOWN IS WHERE YOU NARROW DOWN THE OPACITY, IT'S LABELED
BELOW */
.mejs-playlist li.current {
/* background-color: #bf0101 !important;*/
background-color: rgba(193,1,1,0.5) !important;
opacity: .5;
/* OPACITY ADDED */
}
.mejs-playlist li.current:hover {
/* background-color: #bf0101 !important;*/
background-color: rgba(193,1,1,0.5) !important;
opacity: .5;
/* OPACITY ADDED */
}
.mejs-playlist li:hover {
/* background-color: #bf0101 !important;*/
background-color: rgba(193,1,1,0.5) !important;
opacity: .5;
/* OPACITY ADDED */
}
a:first-child {
color: red;
}
#main label, legend {
color: #FFAE00;
}
span.edd-cart-item-title {
color: #ffffff;
}
span.edd-payment-mode-label {
color: #FFAE00;
}
#edd-email-wrap > span:nth-child(2) {
color: #FFAE00;
}
#edd-first-name-wrap > span:nth-child(2) {
color: #FFAE00;
}
#edd-last-name-wrap > span:nth-child(2) {
color: #FFAE00;
}
#edd-card-country-wrap > span:nth-child(2) {
color: #FFAE00;
}
#edd-card-zip-wrap > span:nth-child(2) {
color: #FFAE00;
}
.edd_checkout_cart_item_title {
/* controls color of the text for the song title in the checkout */
color: #FFAE00;
}
/* Checkout table part 1 */
tr.edd_cart_header_row {
opacity: .5;
}
/* Checkout table part 2 */
tr.edd_cart_item {
opacity: .5;
}
#edd_cc_fields {
/* controls font color of the titles in "card info section" */
color: #FFAE00;
}
#edd_checkout_form_wrap > span.edd-description {
color: #FFAE00;
}
li.cart_item:nth-child(2) {
color: black;
}
#edd-remove-from-cart {
color: red;
}
#edd_remove_from_cart {
color: red;
}
th.edd_cart_actions {
color: #ffffff;
}
/***********************************************************/
#edd_checkout_cart th {
color: #FFAE00;
}
#edd_checkout_cart td {
background-color: #610202;
color: #FFAE00;
}
#edd_checkout_cart .edd_cart_header_row th {
background-color: #610202;
color: #FFAE00;
}/* #edd_discount_code { */
/* for some reason this will allow me to control opactiy, but not the
color? And it won't allow me to take the opacity past .5 (strange) */
/* background-color: #610202; */
/* opacity: .5; */
}
#edd-card-number-wrap, #edd-card-cvc-wrap, #edd-card-name-wrap,
.card- expiration, .edd_before_cc_fields, #edd_before_cc_fields {
background-color: #610202;
color: #FFAE00;
}
The issue I'm having is with the white border around the red section where the customer will be entering in their card details. I've tried everything that I can think of. I've tried adding a z-index. I've attempted to add a surrounding div tag and then apply css to it, but it didn't work. The white area still took precedence. I've tried to change the background of everything by using a "*" and even that didn't change the white section. If anyone can help, I'll greatly appreciate it. Thanks...
You can use the inspect tool in Chrome or Firefox by right clicking the element you want to view and clicking inspect. While inspecting your site, http://www.exiledgrounds.com/checkout/. I found that the white background was being caused by #edd_checkout_form_wrap fieldset#edd_cc_fields. I can't find that in your HTML or CSS, so it must be getting styled from another CSS stylesheet.
Once you find where it is you can just remove the background property or set it to the color you want.

why is div tag not working with css

I'm having issue styling grid view for my product list page. What i want is to style it in a way that four products will be display on each row and with maximum of three rows per page. Currently, what i have is product displaying vertically. Any help?
My code for product.php is:
<?php
$result=mysql_query("select * from products") or die("select * from products"."<br/><br/>".mysql_error());
while($row=mysql_fetch_array($result)){
?>
<div id="product-grid">
<div class="product-item">
<div class="product-image"><img src="<?php echo $row['picture']?>" /></div>
<div><strong><?php echo $row['name']?></strong></div>
<div class="product-description"><?php echo $row['description']?></div>
Price:
<div class="product-price">$<?php echo $row['price']?></div>
<div><input type="button" value="Add to Cart" onclick="addtocart(<?php echo $row['serial']?>)" /></div>
<?php } ?>.
My style is something like this but its not having any desirable effect.
body{width:610px;}
#product-grid {border-top: #F08426 2px solid;margin-bottom:30px;}
#product-grid .txt-heading{background-color: #FFD0A6;}
.product-item { float:left; background:#F0F0F0; margin:15px; padding:5px;}
.product-price {color:#F08426;}
.product-image {height:100px;background-color:#FFF;}
Any help will be appreciated.
You can use flex
Checkout demo below
demo
#product-grid {
display: flex;
flex-wrap:wrap;
}
.product-item {
display: inline-block;
background: #ccc;
margin:10px 0 0 10px;
width: calc(100% * (1/4) - 12px - 1px)
}
close product-item div u just forgot to close product-item div that's why your css is not working.
<?php
$result=mysql_query("select * from products") or die("select * from products"."<br/><br/>".mysql_error());
while($row=mysql_fetch_array($result)){
?>
<div id="product-grid">
<div class="product-item">
<div class="product-image"><img src="<?php echo $row['picture']?>" /></div>
<div><strong><?php echo $row['name']?></strong></div>
<div class="product-description"> <?php echo $row['description']?> </div>
Price:
<div class="product-price">$ <?php echo $row['price']?> </div>
<div>
<input type="button" value="Add to Cart" onclick="addtocart(<?php echo $row['serial']?>)" />
</div>
</div> <!--here you forgot-->
</div>
<?php } ?>
and apply overflow:hidden on #product-grid and width as you want width with float:left no need to add float:left on .product-item so just remove it
#product-grid {
border-top: #F08426 2px solid;
margin-bottom: 30px;
overflow: hidden;
float: left;
width: 25%;
}
fiddle here
Note: I recommend to you use product-item as a class not id always use class for multiple item with same name
thanks
Thanks to every one that respond to my question. It gave me an insight into fixing the problem. I was able to get my grid working using the below code
body {
font-family: "open san", verdana, sans-serif;
font-size: 12px;
line-height: 1.5em;
color: #333;
background: #ffffff;
margin: 0;
padding: 0;
text-align: center;
width: 100%;}
.prod-box{
width: 200px; height: 340px;
padding: 10px; margin: 15px;
background-color: #fff;
float: left;
}
.prod-box img:first-child, .prod-box-list img:first-child{width: 190px; float: left;}
.prod-box h3 a{
text-decoration: none;
width:140px;
float: left;
margin: 5px 0;
color:#888;
font: italic normal 14px georgia;
font-style: italic;
}
.prod-box p{ display: none;}
.prod-box .old{
margin-right: 20px;
color: #be0000 !important;
text-decoration: line-through;
}
.prod-box .price{
width: 60px;
display: inline;
float: left;
font: italic 13px georgia;
color: #181818;
}
.prod-box .cart-ico{
border-radius: 20px;
width: 35px; height: 35px;
float: right;
margin: 5px;
cursor: pointer;
}
.prod-box .cart-ico:hover{
background-color: #7eb800;
}

Multiple divs in absolute

I reached to a problem in my website.
My website is showing all the records in she same page, that each record calls the main div called "work" and inside of that one is calling another one called "worktitle".
I want the worktitle div stays like the image:
Image
But the problem is on the second row. The divs that belongs to the seconda row are in the same place as the first row.
Like you can see here:
Website
HTML Code
<div id="box1">
<?php do { ?>
<div id="work">
<a href="<?php echo $row_works['url']; ?>" target="new">
<img src="images/<?php echo $row_works['image']; ?>" />
<div class="worktitle">
<span class="infotec"><?php echo $row_works['infotec']; ?><br/>
<?php if ((isset($_GET['lang'])) && ($_GET['lang']=="en")) {
echo $row_works['descriptionen']; }
else {
echo $row_works['descriptionpt'];
} ?>
</span>
<span class="title"><?php echo $row_works['title']; ?></span>
</div>
</a>
</div>
<?php } while ($row_works = mysql_fetch_assoc($works)); ?>
</div>
CSS Code
#work {
float: left;
margin: 0px;
padding: 0px;
width : 200px;
border: solid 1px #787879;
}
#work a{
color: #FFF;
text-decoration:none;
}
#work a:hover {
opacity: 0.5;
}
#work img {
margin: 0px;
width: 200px;
z-index: 9;
}
a img{
border: 0;
}
.worktitle {
position: absolute;
top: 200px;
background-color: #787879;
opacity: 0.6;
font-weight: bold;
font-size: 14px;
z-index: 10;
}
.infotec {
font-weight: normal;
font-size:9px;
}
.title {
text-align: right;
}
What am i doing wrong? Please help me out.
First of all id's must be unique in your html so change #work to .work then try giving it a relative position and aligning your description to the bottom.
.work{
position: relative;
}
.worktitle {
position: absolute;
bottom: 0;
}

Resources