http://www.gwendolynbarnes.com/shop/
<ul class="products">
<li class="product first">
<a href="http://www.gwendolynbarnes.com/product/finis/">
<img width="117" height="150" src="http://www.gwendolynbarnes.com/wp-content/uploads/2013/11/1418362_10202191776019152_824444076_n-117x150.jpg" class="attachment-shop_small wp-post-image" alt="1418362_10202191776019152_824444076_n" />
<strong>Finis</strong>
<span class="price">$3,000</span>
</a>
Add to cart
</li>
</ul>
There the HTML im talking about heres the css involved
.products li .price {
color: #fff;
font-weight: bold;
font-size: 18pt;
color: #248022;
}
.products li strong {
font-size: 16pt;
padding-bottom: 10px;
color: #000;
}
.products li {
padding: 10px;
margin: 12px;
}
ul.products li {
width: 30%;
float: left;
padding-left: 100px;
}
.products li a img {
border: 20px solid #fff;
width: 175px;
height: auto;
margin-left: 15px;
margin-right: auto;
}
.products li a img:hover {
border: 20px solid #fff;
}
ul.products {
width: 100%;
float: left;
padding-left: 50px;
}
.products li {
padding: 0px 15px 0px 15px;
background-color: #fff;
border: 20px solid #fff;
}
a.button:hover, button.button:hover, input.button:hover, #review_form #submit:hover {
background: #71d56e;
text-decoration: none;
color: #000;
font-weight: bold;
}
a.button, button.button, input.button, #review_form #submit {
background: #ddd;
text-decoration: none;
color: #000;
font-weight: bold;
}
.products li strong {
font-size: 16pt;
color: #000;
}
You can see it better at
http://www.gwendolynbarnes.com/shop/
But when you hover over the text "Finis"
It removes the border from the image?
Why would the Text have anything to do with the image border anyways? because its inside a
The problem is the following rule in you stylesheet:
.products li a:hover img {
border:1px solid #BBBBBB;
}
Just remove that one and it will work.
Since the border is already set for the image, you could also remove the following rule:
.products li a img:hover {
border:20px solid #FFFFFF;
}
The better solution would be to change the markup in this case as the css may get applied to some other section for which it was created
So I'd suggest
Instead of the code below:
<a href="http://www.gwendolynbarnes.com/product/finis/">
<img width="117" height="150" alt="1418362_10202191776019152_824444076_n" class="attachment-shop_small wp-post-image" src="http://www.gwendolynbarnes.com/wp-content/uploads/2013/11/1418362_10202191776019152_824444076_n-117x150.jpg">
<strong>Finis</strong>
<span class="price">$3,000</span>
</a>
Use this one:
<a href="http://www.gwendolynbarnes.com/product/finis/">
<img width="117" height="150" alt="1418362_10202191776019152_824444076_n" class="attachment-shop_small wp-post-image" src="http://www.gwendolynbarnes.com/wp-content/uploads/2013/11/1418362_10202191776019152_824444076_n-117x150.jpg">
</a>
<strong>Finis</strong>
<span class="price">$3,000</span>
Related
What should I do so that the content of the body is dynamic when hiding and showing the Side Menu? I am trying to create a product management project with PHP.
I have created a Side Menu ( Sidebar ), for which I used a template. The Side Menu also has a navigation bar that contains the button that we use to hide and show the Side Menu.
The new pages or views are added through php, and I want the content of the pages that I add new to occupy the entire screen, with a margin-left: 40px to the left and scroll dynamically when we show the Side Menu When I add a new page, two problems arise:
The content of the new page is overlaid on top of the navigation bar and hidden under the Sidebar.
See the screenshot
I have fixed this problem first by adding margin-top and margin-left
.bodis {
margin-top: 50px;
margin-left: 330px!important;
}
But this is not very dynamic and it is not Responsive either, since when I hide the Sidebar, the content of the pages stays in the center of the page and when the screen size is reduced, the content even disappears.
You can check it in the first screenshot, . You can see that the content disappears when we reduce the size of the screen .
the content of the body remains in the center of the screen when we hide the Side Menu, and in the second screenshot
The template uses several frameworks for css and javascript that I show below. I have read the documentation of some of them, such as Bootstrap, but it is not clear to me what would be the best way to make the dynamic content for each of the screens that I add to the project
Bootstrap V4.3
Bootstrap Material Design V4.0
Font Awesome V5.9.0
Sweet Alerts V8.13.0 CSS file
jQuery Custom Content Scroller V3.1.5
------ javascript ----
jQuery V3.4.1
popper
Bootstrap V4.3
How can I make content dynamic and effective on mobile devices?
How can I make the content of the page occupy almost the entire screen and scroll when showing the Side Menu? Can I use any of the frameworks that the template uses?
I show the bar code of the Side Menu and that of One of the views, in this case the Home
HOME VIEW:
<div class="bodis">
<div class="full-box page-header">
<h1 class="title">Home</h1>
<h2>BIENVENIDO ESTO ES EL HOME</h2>
</div>
</div>
<main class="full-box main-container">
<section class="full-box nav-lateral">
<div class="full-box nav-lateral-bg show-nav-lateral"></div>
<div class="full-box nav-lateral-content">
<figure class="full-box nav-lateral-avatar">
<i class="far fa-times-circle show-nav-lateral"></i>
<img src="./assets/avatar/Avatar.png" class="img-fluid" alt="Avatar">
<figcaption class="roboto-medium text-center">
Leading Company <br><small class="roboto-condensed-light">Panel Administración</small>
</figcaption>
</figure>
<div class="full-box nav-lateral-bar"></div>
<nav class="full-box nav-lateral-menu">
<ul>
<li class="usuarioColor">
<a href="#" class="nav-btn-submenu">
<i class="fas fa-users fa-fw"></i>
Usuarios
<i class="fas fa-chevron-down"></i>
</a>
<ul>
<li>
<a href="index.php?vista=user_new">
<i class="fas fa-plus fa-fw"></i>
Añadir Usuario
</a>
</li>
<li>
<a href="index.php?vista=user_list">
<i class="fas fa-clipboard-list fa-fw"></i>
Lista de Usuarios
</a>
</li>
<li>
<a href="index.php?vista=user_search">
<i class="fas fa-search fa-fw"></i>
Buscar
</a>
</li>
</ul>
</li>
<li class="productosColor">
<a href="#" class="nav-btn-submenu">
<i class="fas fa-file-invoice-dollar fa-fw"></i>
Productos <i class="fas fa-chevron-down"></i></a>
<ul>
<li>
<a href="#">
<i class="fas fa-plus fa-fw"></i>
Añadir Producto</a>
</li>
<li>
<a href="#">
<i class="fas fa-clipboard-list fa-fw"></i>
Lista de Productos</a>
</li>
<li>
<a href="#">
<i class="fas fa-hand-holding-usd fa-fw"></i>
Por Categoria
</a>
</li>
<li>
<a href="#">
<i class="fas fa-search-dollar fa-fw"></i>
Buscar
</a>
</li>
</ul>
</li>
<li>
<i class="fas fa-store-alt fa-fw"></i> Empresa
</li>
</ul>
</nav>
</div>
</section>
<!-- Page content -->
<section class=" full-box page-content">
<nav class="fexid-top full-box navbar-info">
<a href="#" class="float-left show-nav-lateral">
<i class="fas fa-exchange-alt"></i>
</a>
<a href="#">
<i class="fas fa-user-cog"></i>
</a>
<a href="#" class="btn-exit-system">
<i class="fas fa-power-off"></i>
</a>
</nav>
</section>
</main>
#font-face {
font-family: 'roboto_medium_regular';
src: url('../webfonts/roboto-medium-webfont.woff2') format('woff2'),
url('../webfonts/roboto-medium-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
}
#font-face {
font-family: 'roboto_condensed_light';
src: url('../webfonts/robotocondensed-light-webfont.woff2') format('woff2'),
url('../webfonts/robotocondensed-light-webfont.woff') format('woff'),
url('../webfonts/robotocondensed-light-webfont.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
#font-face {
font-family: 'roboto_condensed_regular';
src: url('../webfonts/robotocondensed-regular-webfont.woff2') format('woff2'),
url('../webfonts/robotocondensed-regular-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
}
:root{
--color-one: #F5F5F5;
--color-two: #24292E;
--color-three: #EC5252;
/*--color-three: #0366D6;*/
--form-color: #14111A;
--accent-color: #253556;
/*--accent-color: #455A64;*/
--border-color: #D8D8D8;
}
.bodis {
margin-top: 50px;
margin-left: 330px!important;
}
body,html{
font-family: 'roboto_condensed_light';
width: 100vw;
height: 100vh;
background-color: var(--color-one);
color: #333;
font-size: 16px;
}
.full-box{
margin: 0;
padding: 0;
box-sizing: border-box;
width: 100%;
}
.form-neon{
border: 1px solid var(--border-color);
background-color: #FFF;
padding: 15px;
border-radius: 3px;
}
/*---------- Page headers styles ----------*/
.page-header{
padding: 30px 20px 60px 20px;
}
.page-header > :nth-child(1){
padding-bottom: 7px;
}
.page-header > :nth-child(2){
font-size: 18px;
}
/*---------- Page nav tabs ----------*/
.page-nav-tabs{
display: flex;
justify-content: center;
flex-wrap: wrap;
margin-bottom: 30px;
}
.page-nav-tabs li,
.page-nav-tabs li a{
height: 40px;
line-height: 40px;
}
.page-nav-tabs li{
margin: 5px 20px;
}
.page-nav-tabs li a{
color: var(--accent-color);
font-size: 17px;
min-width: 200px;
width: auto;
display: block;
text-align: center;
user-select: none;
transition: all .2s ease-in-out;
border-bottom: 2px solid transparent;
}
.page-nav-tabs li a.active{
color: var(--color-three);
cursor: none;
pointer-events: none;
}
.page-nav-tabs li a:hover{
text-decoration: none;
color: #333;
border-bottom: 2px solid #333;
}
/*---------- Edit bootstrap styles ----------*/
.form-control[readonly]{
background-color: transparent;
}
.form-control:focus,
.form-control:active{
outline: none;
box-shadow: none;
border: none;
}
.form-control-file:active,
.form-control-file:focus{
outline: none;
}
.table .btn{
margin-bottom: 0;
}
.table thead th{
color: #FFF;
}
.table tbody tr{
color: #333;
transition: all .2s ease-in-out;
}
.table-dark,
.table{
background-color: #fff;
}
.table-dark{
border: 1px solid var(--accent-color);
}
.table-dark thead tr{
background-color: var(--accent-color);
}
.table-dark td,
.table-dark thead th,
.table-dark th{
border: none;
}
.table-dark tr:hover{
color: var(--color-three);
background-image: linear-gradient(to right, transparent, rgba(124, 100, 112, .2) 85%, transparent);
}
.page-link{
transition: all .2s ease-in-out;
}
.page-link:hover{
background-color: var(--color-three);
color: #FFF;
}
table form{
margin-bottom: 0;
}
/*---------- Text Styles ----------*/
.roboto-medium{
font-family: 'roboto_medium_regular';
}
.roboto-condensed-light{
font-family: 'roboto_condensed_light';
}
.roboto-condensed-regular{
font-family: 'roboto_condensed_regular';
}
/*---------- login Styles ----------*/
.login-container{
width: 100vw;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background: #0575E6;
background: -webkit-linear-gradient(to right, #021B79, #0575E6);
background: linear-gradient(to right, #021B79, #0575E6);
}
.login-content{
width: 95%;
max-width: 320px;
height: auto;
border: 1px solid var(--border-color);
background-color: #FFF;
border-radius: 4px;
padding: 15px;
color: var(--accent-color);
}
.btn-login{
width: 90%;
padding: 10px 0;
display: block;
margin: 0 auto;
border-radius: 3px;
margin-top: 30px;
background-color: transparent;
color: var(--accent-color);
border: 1px solid var(--accent-color);
transition: all .2s ease-out;
}
.btn-login:hover{
background-color: var(--color-three);
border: 1px solid var(--color-three);
text-decoration: none;
color: #fff;
}
.btn-login:active,
.btn-login:focus{
outline: none;
}
/*---------- Page layout Styles ----------*/
.main-container{
height: 100%;
position: absolute;
top: 0;
left: 0;
overflow: hidden;
}
.page-content,
.nav-lateral{
height: 100%;
overflow: hidden;
}
.page-content{
position: fixed;
padding-left: 300px;
transition: all .2s ease-in-out;
padding-bottom: 20px;
}
/***********************/
/* Nav Lateral */
/***********************/
/* COLORES DE LAS LISTAS */
/* nav > ul > li a:hover {
background: white !important;
color:#47748b !important;
} */
.usuarioColor {
background: rgb(239, 149, 54);
}
.nav-lateral{
width: 300px;
position: absolute;
top: 0;
left: 0;
z-index: 1;
transition: all .2s ease-in-out;
background-image: url('../assets/img/nav-font.jpg');
background-position: center center;
background-size: cover;
}
.nav-lateral-bg{ display: none; }
.nav-lateral-content{
max-width: 300px;
height: 100%;
background-color: rgba(36, 41, 46, .8);
}
.nav-lateral-bar{
height: 3px;
background-color: var(--color-three);
}
.nav-lateral-avatar{
padding: 40px 0;
}
.nav-lateral-avatar i{
display: none;
}
.nav-lateral-avatar img{
width: 50%;
margin: 0 auto;
display: block;
border: 4px solid #FFF;
border-radius: 100%;
}
.nav-lateral-avatar figcaption{
margin-top: 20px;
color: #FFF;
}
.nav-lateral-menu{
height: auto;
}
.nav-lateral-menu ul{
margin: 0;
padding: 0;
list-style: none;
}
.nav-lateral-menu ul li{
width: 100%;
height: auto;
}
.nav-lateral-menu ul li a{
display: block;
width: 100%;
height: 45px;
line-height: 45px;
text-decoration: none;
color: #FFF;
font-size: 17px;
box-sizing: border-box;
padding-left: 20px;
transition: all .2s ease-in-out;
}
.nav-lateral-menu ul li a.active{
color: #FFF;
background-color: var(--color-three);
}
.nav-lateral-menu ul li a:hover{
color: #fff;
background-image: linear-gradient(to right, transparent, rgba(255, 255, 255, .1) 50%, transparent);
}
.nav-lateral-menu ul li ul{
display: none;
border: 1px solid var(--color-three);
background: rgba(20, 30, 48, .5);
}
.nav-lateral-menu ul li ul a{
padding-left: 45px;
}
.show-nav-lateral-submenu{
display: block !important;
}
.nav-lateral-menu .fa-chevron-down,
.nav-lateral-menu .fa-chevron-up{
float: right;
height: 45px;
line-height: 45px;
margin-right: 7px;
transition: all .2s ease-in-out;
}
/* Page content */
.navbar-info{
height: 50px;
border-bottom: 1px solid var(--border-color);
text-align: right;
padding-right: 10px;
}
.navbar-info a{
color: var(--accent-color);
height: 50px;
min-width: 40px;
text-align: center;
line-height: 50px;
display: inline-block;
transition: all .2s ease-out;
user-select: none;
}
.navbar-info a:hover{
color: var(--color-three);
background-image: radial-gradient(circle,rgba(250, 30, 78, .1), transparent 80%);
}
.navbar-info a:active,
.navbar-info a:focus{
outline: none;
}
/*---------- Home Styles ----------*/
.tile-container{
text-align: center;
padding: 20px 25px;
}
.tile{
height: 200px;
width: 200px;
margin: 10px;
display: inline-block;
text-decoration: none;
color: var(--accent-color);
border: 1px solid var(--border-color);
border-radius: 3px;
user-select: none;
transition: all .2s ease-in-out;
background-color: #FFF;
}
.tile:hover{
text-decoration: none;
border-color: var(--color-three);
}
.tile:focus,
.tile:active{
outline: none;
}
.tile-tittle{
margin: 0;
width: 100%;
padding: 0;
height: 40px;
line-height: 40px;
box-sizing: border-box;
text-transform: uppercase;
border-bottom: 1px solid var(--border-color);
transition: all .2s ease-in-out;
font-family: 'roboto_medium_regular';
}
.tile:hover .tile-tittle{
color: #FFF;
border-color: var(--color-three);
background-color: var(--color-three);
}
.tile-icon{
width: 100%;
height: 160px;
box-sizing: border-box;
padding-top: 22px;
}
.tile-icon > i{
font-size: 80px;
}
.tile-icon > p{
font-family: 'roboto_medium_regular';
height: 35px;
line-height: 35px;
}
.tile:hover .tile-icon > i,
.tile:hover .tile-icon > p{
color: var(--color-three);
}
/*---------- Breakpoints ----------*/
#media (max-width: 767px){
.nav-lateral{
width: 100%;
overflow: hidden;
display: none;
background-image: none;
}
.nav-lateral.active{
display: block;
z-index: 9999;
}
.nav-lateral-bg{
width: 100%;
height: 100%;
background-color: rgba(3, 3, 3, .4);
position: relative;
display: block;
z-index: 2;
}
.nav-lateral-content{
position: absolute;
left: 0;
top: 0;
z-index: 3;
transform: translateX(-400px);
transition: all .3s ease-in-out;
background-color: var(--color-two);
}
.nav-lateral.active .nav-lateral-content{
transform: translateX(0);
}
.nav-lateral-avatar i{
height: 50px;
width: 50px;
line-height: 50px;
color: #FFF;
cursor: pointer;
font-size: 25px;
position: absolute;
top: 5px;
right: 0;
text-align: center;
display: block;
transition: all .2s ease-out;
}
.nav-lateral-avatar i:hover{
color: var(--color-three);
}
.page-content{
padding-left: 0;
}
}
/* Bootstrap breakpoints */
#media (min-width: 576px){
}
#media (min-width: 768px){
.nav-lateral.active{
transform: translateX(-400px);
}
.page-content.active{
padding-left: 0;
}
}
#media (min-width: 992px){
}
#media (min-width: 1200px){
}
/*---------- Keyframes ----------*/
I have tried to fix this error by adding margin-top and margin-left :
.bodis {
margin-top: 50px;
margin-left: 330px!important;
}
But the result still does not meet the desired.
I have read the bootstrap documentation trying to find a solution, but I don't see that it is the best for my needs
I have tried to implement the answers of this question, but it didn't work in my case
I finally found a solution to my problem, and although I can't add all the code here, the solution was very simple.
I have only ordered my css files and removed what is not necessary, to avoid problems.
For views that are added back to my app, I put them inside two div.
The parent wraps everything and has the following css:
bodysuits {
margin-top: 80px;
overflow-y: hidden;
width:100%;
}
.body .content {
padding: 20px;
}
And we also add a second div with the div class="content"
In this way my different pages would look like this:
<div class="bodis page-content">
<div class="content">
<h1 class="title ">Title</h1>
<h2 class="subtitle">Subtitle</h2>
<!-- THE REST OF THE CONTENT --!>
</div>
</div>
Update the media query code by changing the width from 100% to 300px like so;
#media(max-width: 767px)
.nav-side-bg {
width: 300px;
height: 100%;
background-color: rgba(3, 3, 3, .4);
position: relative;
display: block;
z-index: 2;
}
All this worked and I am encouraged to study css more intensely since I see that it is a very powerful language in web layout
I have hidden my sub menu, and added css to show the sub menu drop down when hovering over the parent menu item.
What I would like to do is have the sub menu drop down when the parent menu button is "clicked" instead of when it is "hovered" over.
My css is:
.sub-menu {
display: none;
}
.shiftnav ul li:hover > ul {
display: block; /* show sub menus when hovering over a parent */
}
I Made and Example
Here is HTML Codes:
#demo {
margin: 30px 0 50px 0;
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
}
#demo .wrapper {
display: inline-block;
width: 180px;
margin: 0 10px 0 0;
height: 20px;
position: relative;
}
#demo .parent {
height: 100%;
width: 100%;
display: block;
cursor: pointer;
line-height: 30px;
height: 30px;
border-radius: 5px;
background: #F9F9F9;
border: 1px solid #AAA;
border-bottom: 1px solid #777;
color: #282D31;
font-weight: bold;
z-index: 2;
position: relative;
-webkit-transition: border-radius .1s linear, background .1s linear, z-index 0s linear;
-webkit-transition-delay: .8s;
text-align: center;
}
#demo .parent:hover,
#demo .content:hover ~ .parent {
background: #fff;
-webkit-transition-delay: 0s, 0s, 0s;
}
#demo .content:hover ~ .parent {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
z-index: 0;
}
#demo .content {
position: absolute;
top: 0;
display: block;
z-index: 1;
height: 0;
width: 180px;
padding-top: 30px;
-webkit-transition: height .5s ease;
-webkit-transition-delay: .4s;
border: 1px solid #777;
border-radius: 5px;
box-shadow: 0 1px 2px rgba(0, 0, 0, .4);
}
#demo .wrapper:active .content {
height: 123px;
z-index: 3;
-webkit-transition-delay: 0s;
}
#demo .content:hover {
height: 123px;
z-index: 3;
-webkit-transition-delay: 0s;
}
#demo .content ul {
background: #fff;
margin: 0;
padding: 0;
overflow: hidden;
height: 100%;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
}
#demo .content ul a {
text-decoration: none;
}
#demo .content li:hover {
background: #eee;
color: #333;
}
#demo .content li {
list-style: none;
text-align: left;
color: #888;
font-size: 14px;
line-height: 30px;
height: 30px;
padding-left: 10px;
border-top: 1px solid #ccc;
}
#demo .content li:last-of-type {
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
}
<div id="demo">
<div class="wrapper">
<div class="content">
<ul>
<a href="#">
<li>Lorem ipsum dolor</li>
</a>
<a href="#">
<li>Consectetur adipisicing</li>
</a>
<a href="#">
<li>Reprehenderit</li>
</a>
<a href="#">
<li>Commodo consequat</li>
</a>
</ul>
</div>
<div class="parent">Drop Down Parent 1</div>
</div>
<div class="wrapper">
<div class="content">
<ul>
<a href="#">
<li>Lorem ipsum dolor</li>
</a>
<a href="#">
<li>Consectetur adipisicing</li>
</a>
<a href="#">
<li>Reprehenderit</li>
</a>
<a href="#">
<li>Commodo consequat</li>
</a>
</ul>
</div>
<div class="parent">Drop Down Parent 2</div>
</div>
You can achieve nearly the same thing with li a:first-child:nth-last-child(x) { }.
Here is a quick example. The markup is just your standard nested UL, but note that I have only used one class in the HTML, on the root <ul>. Test this out yourself, add any number of nested lists at any level!
I have this code i use for my website to display text and a button:
<?php if ($slide1 != null ) : ?><li><img src="<?php echo $this->baseurl ?>/<?
php echo htmlspecialchars($slide1); ?>" /><p class="caption">
<?php echo ($slidedesc1); ?>Meer info</p></li>
Right now the entire thing is displayed as a button with the class "caption". I only want class "caption" to be aplied on "Meer info" and not to "$slidedesc1". How would I do that? Do I change the position of class?
Caption properties:
.callbacks .caption {
color: #fff;
display: block;
font-size: 45px;
max-width: none;
position: absolute;
text-align: center;
text-shadow: 0 0 1px #555;
top: 20%;
width: 100%;
z-index: 2;
}
.callbacks .caption a {
background-color: #3498DB;
border-bottom: 5px solid #2980B9;
position: relative;
padding: 10px 40px;
margin: 0px 10px 10px 0px;
border-radius: 10px;
font-family: 'Pacifico', cursive;
font-size: 25px;
color: #FFF !important;
text-decoration: none;
z-index:11;
}
.callbacks .caption a:hover
{background: #555; border-bottom: 5px solid #000; text-decoration:none;}
.callbacks .caption a:active
{
transform: translate(0px,5px);
-webkit-transform: translate(0px,5px);
border-bottom: 5px solid #333;
transition: all 0.1s;
-webkit-transition: all 0.1s;
background-color: #444;
}
try this code :
<?php if ($slide1 != null ) : ?><li><img src="<?php echo $this->baseurl ?>/<?
php echo htmlspecialchars($slide1); ?>" /><p>
<?php echo ($slidedesc1); ?><span class="caption">Meer info</span></p></li>
Does this work?
<?php
if ($slide1 != null ) {
echo "
<li>
<img src='".$this->baseurl."'".htmlspecialchars($slide1) ."/>
<p>
<a href='/algemene-informatie'>
$slidedesc1
<label class='caption'>
Meer info
</label>
</a>
</p>
</li>
"
?>
I am having trouble with the layout of a website I'm making.
I'm not very good with CSS.
So the trouble I'm having is that I want to have a horizontal menu bar that I want to center in my website. This menu can have dropdown children.
The implementation is in jQuery.
So this is the HTML code of my menu bar :
<ul class='dropdown'>
<li><a href='index.php'>Home</a></li>
<li><a href='#'>Incident</a>
<ul class='sub_menu'>
<li><a href='index.php?action=new'>New</a></li>
<li><a href='index.php?action=edit'>Edit</a></li>
<li><a href='index.php?action=manage'>Manage</a></li>
</ul>
</li>
<li><a href='action_logout.php'>Log out</a></li>
</ul>
and this is the CSS that is being implemented :
* { margin: 0; padding: 0; }
body { font: 14px Helvetica, Sans-Serif; margin: 15px; }
a { text-decoration: none; }
ul { width: 800px; list-style: none; text-align: center; margin: auto; padding: 2px 2px;}
p { margin: 15px 0; }
/*
LEVEL ONE
*/
ul.dropdown { position: relative; }
ul.dropdown li { display: inline; font-weight: bold; background: #ccc; padding: 2px 2px; border-bottom: 1px solid #777; }
ul.dropdown a:hover { color: #000; }
ul.dropdown a:active { color: #ffa500; }
ul.dropdown li a { display: inline; padding: 2px 8px; border-right: 1px solid #777; border-bottom: 1px solid #777;
color: #222; }
ul.dropdown li:last-child a { border-right: none; } /* Doesn't work in IE */
ul.dropdown li.hover,
ul.dropdown li:hover { background: #F3D673; color: black; position: relative; }
ul.dropdown li.hover a { color: black; }
/*
LEVEL TWO
*/
ul.dropdown ul { width: 175px; visibility: hidden; position: absolute; top: 100%; left: 0; text-align: left; }
ul.dropdown ul li { font-weight: normal; background: #f6f6f6; color: #000;
border-bottom: 1px solid #ccc; float: none; }
/* IE 6 & 7 Needs Inline Block */
ul.dropdown ul li a { border-right: none; width: 100%; display: inline-block; }
An Example can be seen here.
I did manage to center my menu bar after all. However there seems to be a little gap between Home and Incident menus and I've no idea how to get rid of it.
Any ideas?
Thank you in advance.
Somehow you managed to put whitespace outside <li> element, here is absolutely same code with whitespace removed:
http://jsfiddle.net/fPAFs/1/
How about this: http://dabblet.com/gist/2520870
Your code was a mess.
<style>
* {
padding: 0;
margin: 0;
}
body {
font-family: helvetica, serif;
font-size: 14px;
}
ul {
list-style-type: none;
}
.dropdown {
text-align: center;
font-size: 0;
margin: 15px;
}
ul.dropdown ul {
width: 220px;
visibility: hidden;
position: absolute;
top: 1.8em;
left: 0;
}
ul.dropdown ul li a {
font-weight: normal;
background: #f6f6f6;
color: #000;
border-bottom: 1px solid #ccc;
float: none;
}
.dropdown > li {
display: inline-block;
height: 1.2em;
font-size: 14px;
position: relative;
}
.dropdown li a {
display: block;
background: rgb(204, 204, 204);
border-bottom: rgb(119, 119, 119) 1px solid;
border-right: rgb(119, 119, 119) 1px solid;
padding: 0.3em;
color: rgb(0, 0, 0);
text-decoration: none;
font-weight: bold;
}
.dropdown li a:hover {
background: rgb(243, 214, 115);
}
</style>
<ul class='dropdown'>
<li><a href='index.php'>Home</a></li>
<li><a href='#'>Incident</a>
<ul class='sub_menu'>
<li><a href='index.php?action=new'>New</a></li>
<li><a href='index.php?action=edit'>Edit</a></li>
<li><a href='index.php?action=manage'>Manage</a></li>
</ul>
</li>
<li><a href='action_logout.php'>Log out</a></li>
</ul>
Try this new code. Though I urge you to not try and implement someone else's code without understanding it first!
I got this code which address my "Get the 1st image of the post then display it" issue.
<?php echo get_first_image() ?>
My problem is, how to i make it to automatically adjust its size (lets say 50x50) then display it.
What i want to to do is simply get the image from my published post, resize it (50x50 and 250x250) then display it. It will be use in a slider/enhance version of recent post.
thank you very much!
HERES THE CODE of the SLIDER/Recent post
$(".main_image .desc").show();
$(".main_image .block").animate({ opacity: 0.85 }, 1 );
$(".image_thumb ul li:first").addClass('active');
$(".image_thumb ul li").click(function(){
//Set Variables
var imgAlt = $(this).find('img').attr("alt");
var imgTitle = $(this).find('a').attr("href");
var imgDesc = $(this).find('.block').html();
var imgDescHeight = $(".main_image").find('.block').height();
if ($(this).is(".active")) {
return false;
} else {
//Animate the Description
$(".main_image .block").animate({ opacity: 0, marginBottom: -imgDescHeight }, 250 , function() {
$(".main_image .block").html(imgDesc).animate({ opacity: 0.85, marginBottom: "0" }, 250 );
$(".main_image img").attr({ src: imgTitle , alt: imgAlt});
});
}
//Show active list-item
$(".image_thumb ul li").removeClass('active');
$(this).addClass('active');
return false;
}) .hover(function(){
$(this).addClass('hover');
}, function() {
$(this).removeClass('hover');
});
$("a.collapse").click(function(){
$(".main_banner .block").slideToggle();
$("a.collapse").toggleClass("show");
});
<div class="main_image">
<img src="banner1.jpg" alt="" />
<div class="desc">
Close Me!
<div class="block">
<h2>Title</h2>
<small>Date</small>
<p>Copy</p>
</div>
</div>
</div>
<div class="image_thumb">
<ul>
<li>
<img src="image\banner1_thumb.jpg" alt="image1234" />
<div class="block">
<h2>Title</h2>
<small>Date</small>
<p>Copy</p>
</div>
</li>
</ul>
</div>
.main_image {
width: 598px;
height: 456px;
float: left;
background: #333;
position: relative;
overflow: hidden;
color: #fff;
}
.main_image h2 {
font-size: 2em;
font-weight: normal;
margin: 0 0 5px;
padding: 10px;
}
.main_image p {
font-size: 1.2em;
line-height: 1.6em;
padding: 10px;
margin: 0;
}
.block small {
font-size: 1em;
padding: 0 0 0 20px;
background: url(iconcalendarKO.gif) no-repeat 0 center;
}
.main_image .block small {margin-left: 10px;}
.main_image .desc{
position: absolute;
bottom: 0;
left: 0;
width: 100%;
display: none;
.main_image .block{
width: 100%;
background: #111;
border-top: 1px solid #000;
}
.main_image a.collapse {
background: url(btn_collapse.gif) no-repeat left top;
height: 27px;
width: 93px;
text-indent: -99999px;
position: absolute;
top: -27px;
right: 20px;
}
.main_image a.show {background-position: left bottom;}image_thumb section CSS
.image_thumb {
float: left;
width: 299px;
background: #f0f0f0;
border-right: 1px solid #fff;
border-top: 1px solid #ccc;
}
.image_thumb img {
border: 1px solid #ccc;
padding: 5px;
background: #fff;
float: left;
}
.image_thumb ul {
margin: 0;
padding: 0;
list-style: none;
}
.image_thumb ul li{
margin: 0;
padding: 12px 10px;
background: #f0f0f0 url(nav_a.gif) repeat-x;
width: 279px;
float: left;
border-bottom: 1px solid #ccc;
border-top: 1px solid #fff;
border-right: 1px solid #ccc;
}
.image_thumb ul li.hover {
.image_thumb {
float: left;
width: 299px;
background: #f0f0f0;
border-right: 1px solid #fff;
border-top: 1px solid #ccc;
}
.image_thumb img {
border: 1px solid #ccc;
padding: 5px;
background: #fff;
float: left;
}
.image_thumb ul {
margin: 0;
padding: 0;
list-style: none;
}
.image_thumb ul li{
margin: 0;
padding: 12px 10px;
background: #f0f0f0 url(nav123_a.gif) repeat-x;
width: 279px;
float: left;
border-bottom: 1px solid #ccc;
border-top: 1px solid #fff;
border-right: 1px solid #ccc;
}
.image_thumb ul li.hover {
background: #ddd;
cursor: pointer;
}
.image_thumb ul li.active {
background: #fff;
cursor: default;
}
html .image_thumb ul li h2 {
font-size: 1.5em;
margin: 5px 0;
padding: 0;
}
.image_thumb ul li .block {
float: left;
margin-left: 10px;
padding: 0;
width: 170px;
}
.image_thumb ul li p{display: none;}
isnt get_the_post_thumbnail enough?
Just call it twice, with different sizes