I am currently working on my tumblr theme footer size. I changed the paddings of the ".post .footer" so that it would be smaller and came up with:
#wrapper #content .post .footer {
background: {color:Footer} url({image:footer});
{block:IfFooterBorder}
border: {text:Footer Border}px solid {color:Footer Border};
{/block:IfFooterBorder}
font-family: {text:font family secondary};
font-size: 9px;
color: {color:Footer text};
padding:4px 8px;
margin-top:15px;margin-bottom:8px;
line-height:8px; z-index:10;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
transition: all 0.2s linear;
}
#wrapper #content .post .footer .date {
width: 67%;
float: left;
}
#wrapper #content .post .footer .notes {
width: 33%;
float: right;
text-align: right;
}
#wrapper #content .post .footer .notes a, #wrapper #content .post .footer .date a {
color: {color:Footer link};
text-decoration:none;
}
#wrapper #content .post .footer .tags a {
color: {color:Footer link};
{block:ifnotlinkunderline}
text-decoration: none;
{/block:ifnotlinkunderline}
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
transition: all 0.2s linear;
font-size: 10px;
}
So then I tested it and am satisfied with the size. But then i noticed that the second footer (footer for the post tags)'s size is slightly bigger than the first footer (the footer for the time or date and notes).
So then i decided to edit it and add a separate section for the "tags" footer. I placed this in between ".post .footer .notes a,.post .footer .date a" and " .post .footer .tags a":
#wrapper #content .post .footer .tags {
padding:0px 0px;
}
I put in 0px paddings so that the size would be smaller as there are no paddings. But it still did not work so i changed the paddings to:
#wrapper #content .post .footer .tags {
padding:-1px -1px;
}
Then i tested it, but it still did not work. What's going on? The second footer's size is still bigger and the footers are still imbalanced. Am I missing something here?
Okay, tag is an inline element by default, so you need to add display:block; to it so that it can adapt to your custom width and height.
#wrapper #content .post .footer .tags a {
color: #ffdaf4;
text-decoration: none;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
transition: all 0.2s linear;
font-size: 10px;
font-style: italic;
cursor: help;
display: block; //add this line to change the height
line-height: 8px; // add this line to vertical center your text for better looking
}
Related
I was expecting this from Internet Explorer, but my beloved Firefox let me down on this one.
This fiddle will not work (at least for me it did not) on Firefox and I would like to know why. I have seen a lot of documentation and I guess this should be working.
Here is the fiddle: http://jsfiddle.net/6UFX7/11300/
HTML:
<div id="nav">
<ul>
<li><a>ENTRY</a></li>
<li><a>ENTRY</a></li>
<li><a>ENTRY</a></li>
<li><a>ENTRY</a></li>
<li><a>ENTRY</a></li>
</ul>
</div>
CSS:
#nav
{
height:60px;
background-color:#FFFFFF;
overflow:hidden;
}
#nav ul
{
color: #f2f2f2;
margin-top:20px;
list-style-type: none;
text-align: center;
float:left;
}
#nav ul li
{
display: inline-block;
*display: inline;
zoom: 1;
margin: 0 10px;
}
#nav ul li a
{
color: #8198A0;
font-style: normal;
font-size: 14px;
font-weight: 500;
letter-spacing: 0.25px;
text-transform: uppercase;
text-decoration: none;
-webkit-transition: color 0.5s ease;
-moz-transition: color 0.5s ease;
-o-transition: color 0.5s ease;
transition: color 0.5s ease;
}
#nav ul li a:after
{
margin-top:16px;
content: "";
display: block;
height: 5px;
width: 0;
-webkit-transition: width 0.5s ease, background-color 0.5s ease;
-moz-transition: width 0.5s ease, background-color 0.5s ease;
-o-transition: width 0.5s ease, background-color 0.5s ease;
transition: width 0.5s ease, background-color 0.5s ease;
pointer-events:none;
}
#nav ul li a:hover:after
{
width: 100%;
background-color:#8198A0;
}
#nav ul li a:hover
{
cursor: pointer;
}
One more quick question about "pointer-events:none":
It is working fine on Internet Explorer but not on Chrome (I could not test it on Firefox because the above problem).
Thanks in advance!
This appears to be because the #nav ul li a elements are the default display: inline. Adding display: inline-block; to these elements fixes the issue.
Working Example:
#nav
{
height:60px;
background-color:#FFFFFF;
overflow:hidden;
}
#nav ul
{
color: #f2f2f2;
margin-top:20px;
list-style-type: none;
text-align: center;
float:left;
}
#nav ul li
{
display: inline-block;
*display: inline;
zoom: 1;
margin: 0 10px;
}
#nav ul li a
{
color: #8198A0;
font-style: normal;
font-size: 14px;
font-weight: 500;
letter-spacing: 0.25px;
text-transform: uppercase;
text-decoration: none;
display: inline-block;
-webkit-transition: color 0.5s ease;
-moz-transition: color 0.5s ease;
-o-transition: color 0.5s ease;
transition: color 0.5s ease;
}
#nav ul li a:after
{
margin-top:16px;
content: "";
display: block;
height: 5px;
width: 0;
-webkit-transition: width 0.5s ease, background-color 0.5s ease;
-moz-transition: width 0.5s ease, background-color 0.5s ease;
-o-transition: width 0.5s ease, background-color 0.5s ease;
transition: width 0.5s ease, background-color 0.5s ease;
pointer-events:none;
}
#nav ul li a:hover:after
{
width: 100%;
background-color:#8198A0;
}
#nav ul li a:hover
{
cursor: pointer;
}
<div id="nav">
<ul>
<li><a>ENTRY</a></li>
<li><a>ENTRY</a></li>
<li><a>ENTRY</a></li>
<li><a>ENTRY</a></li>
<li><a>ENTRY</a></li>
</ul>
</div>
As for the pointer-events issue, if this does not solve that issue as-well, you should probably ask a question specifically about that.
I have ben boxing with this issue for ages now.
I have a parent div "wrapper" containing a child div "sidebar-wrapper" consisting of an ul with li in it.
I want "sidebar-wrapper"s height to fit "wrappers" height. My issue is when i set its height to auto goes 0.
My HTML:
<div id="wrapper">
<!-- Sidebar -->
<div id="sidebar-wrapper">
<ul class="sidebar-nav">
<li class="sidebar-brand">
<a href="#">
a lit of these li's
</a>
</li>
</ul>
</div>
<!-- Page Content -->
<div id="page-content-wrapper">
<div class="container-fluid">
<div class="row">
Whatever Content!!
</div>
</div>
</div>
</div>
My css:
#wrapper {
overflow:auto;
border: 1px solid #000000;
width: 100%;
min-height:400px;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#sidebar-wrapper {
margin-left: -150px;
overflow-y: auto;
background: #000;
height:400px;
float:left;
background-color:#222222;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#page-content-wrapper {
width: 100%;
position: absolute;
padding: 15px;
}
.sidebar-nav li {
text-indent: 20px;
line-height: 40px;
}
.sidebar-nav li a {
display: block;
text-decoration: none;
color: #999999;
}
See this fiddle
The CSS used is as follows
html,body{
height: 100%;
}
#wrapper {
overflow:auto;
border: 1px solid #000000;
width: 100%;
height: 100%;
min-height:400px;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#sidebar-wrapper {
margin-left: -150px;
overflow-y: auto;
background: #000;
height:100%;
float:left;
background-color:#222222;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#page-content-wrapper {
width: 100%;
position: absolute;
padding: 15px;
}
.sidebar-nav li {
text-indent: 20px;
line-height: 40px;
}
.sidebar-nav li a {
display: block;
text-decoration: none;
color: #999999;
}
I've given height:100% for html,body,wrapper and body-content..
Setting height to auto just sets the height equal to the height of the contents of the div..here i think you want the height to be equal to the wrapper..so you'll have to set it to 100%.
and this is how can i see your website after making the specified changes..
Change the sidewrapper height to 100% and give the wrapper a height: see fiddle: See fiddle
#wrapper {
overflow:auto;
border: 1px solid #000000;
width: 100%;
height: auto; /* example height */
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#sidebar-wrapper {
margin-left: -150px;
overflow-y: auto;
background: #000;
height:100%;
float:left;
background-color:#222222;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#page-content-wrapper {
width: 100%;
position: absolute;
padding: 15px;
}
.sidebar-nav li {
text-indent: 20px;
line-height: 40px;
}
.sidebar-nav li a {
display: block;
text-decoration: none;
color: #999999;
}
Set the parent div's position to relative and children div's to absolute:
#wrapper {
...
...
/**** added css ****/
position:relative;
/*********************/
...
...
}
Edit 1
as you commented, I came to learn that you want the sidebar to available throughout the page regardless the height of the page.
If that is the case then "wrapper" div has nothing to do with.
Just set the position of "sidebar-div" to "fixed" and give proper top and bottom margins according to your page header and footer margins:
and set the top and bottom of child wrapper to 0:
#sidebar-wrapper {
...
...
/**** added css ****/
position:fixed;
top:10px;
bottom:10px;
/*********************/
...
...
}
Here's the updated demo JS fiddle link:
Updated Demo JS Fiddle Link
Hope that helps!
Take a look at this: http://jsfiddle.net/8D4f4/1/
The problem is that the li-element is too high. You can see that the list element got a grey background. You can see the grey under the image.
The question is. Why is the li element higher than the image?
I need the li element to have the same height as the image.
html
<div id="content">
<ul id="references-all" class="references">
<li data-id="online">
<img src="http://s1.directupload.net/images/140627/779m36rh.jpg"
width="324" height="240" class="references-images">
<div class="description">
<img src="http://s14.directupload.net/images/140627/z49aajek.png">
<div>
<p>Lorem Ipsum Lorem</p>
<img src="http://s1.directupload.net/images/140627/g8yce4ta.png"
width="28" height="27" class="description-arrow">
</div>
</div>
</li>
</ul>
</div>
css
#content .references {
margin-bottom: 50px;
max-width: 980px;
width: 100%;
}
#content .references li {
background-color: darkgrey;
float: left;
margin: 1px;
max-width: 404px;
min-width: 225px;
overflow: hidden;
position: relative;
width: 33%;
}
#content .references li:hover > .description{
background-color: #78785a;
height:100px;
}
#content .references li .references-images {
height: auto;
width: 100%;
-webkit-transition: all 0.5s ease-in;
-moz-transition: all 0.5s ease-in;
-ms-transition: all 0.5s ease-in;
-o-transition: all 0.5s ease-in;
transition: all 0.5s ease-in;
}
.description {
bottom: 0;
color: #ffffff;
display: block;
height: 50px;
overflow: hidden;
padding: 7px 0 0 5px;
position: absolute;
-webkit-transition: all 0.5s ease-in;
-moz-transition: all 0.5s ease-in;
-ms-transition: all 0.5s ease-in;
-o-transition: all 0.5s ease-in;
transition: all 0.5s ease-in;
width: 100%;
}
.description p {
color: #ffffff;
display: block;
float: left;
font-size: 0.800em;
margin: 0;
padding-bottom: 15px;
padding-top: 10px;
width: 85%;
-webkit-transition: all 0.5s ease-in;
-moz-transition: all 0.5s ease-in;
-ms-transition: all 0.5s ease-in;
-o-transition: all 0.5s ease-in;
transition: all 0.5s ease-in;
}
.description .description-arrow {
float: left;
margin-top: 10px;
}
li's height is greater than img's, because img's layout is similar to inline-block and it positions img's bottom edge to the text's baseline which is causing spacing to appear for the text descenders. In your case you can just add vertical-align property to the img element to remove spacing below the image :
img { vertical-align:top; }
JSFiddle
set display:block on your <li> and your <img>
#content .references li {
display:block;
}
#content .references li .references-images {
display:block;
}
Fixed Fiddle
Here's my Fiddle:
#facebookIcon{
vertical-align:middle;
color:white;
font-size:5.5em;
opacity:0.4;
}
#facebookinner:hover #facebookIcon{
opacity:1.0;
}
#facebookinner{
background:#3b5998;
border-radius:100px;
height:100px;
width:100px;
margin:0 auto;
text-align:center;
line-height:100px;
opacity:0.4;
-webkit-transition:
}
#facebookinner:hover{
opacity:1.0;
}
#facebookouter {
background-color:Green;
border:5px solid rgba(0,0,0,0);
height:100px;
width:100px;
border-radius:100px;
display: table-cell;
vertical-align: middle;
-webkit-transition: height 0.2s linear, width 0.2s linear,border 0.2s ease-out,border- radius 0.2s linear,margin 0.2s linear;
transition: height 0.2s linear, width 0.2s linear,border 0.2s ease-out,border-radius 0.2s linear,margin 0.2s linear;
-moz-transition: height 0.2s linear, width 0.2s linear,border 0.2s ease-out,border-radius 0.2s linear,margin 0.2s linear;
}
#facebookouter:hover {
height:130px;
width:130px;
border-radius:130px;
border:5px solid #3b5998;
opacity:1.0;
-webkit-transition: height 0.2s linear, width 0.2s linear,border 0.2s ease- out,border-radius 0.2s linear,margin 0.2s linear;
transition: height 0.2s linear, width 0.2s linear,border 0.2s ease-out,border-radius 0.2s linear,margin 0.2s linear;
-moz-transition: height 0.2s linear, width 0.2s linear,border 0.2s ease-out,border-radius 0.2s linear,margin 0.2s linear;
}
footer {
margin-top:250px;
height:150px;
position: absolute;
right: 0;
bottom: 10;
left: 0;
padding: 5 rem;
background-color: Green;
text-align: center;
padding-top:30px;
padding-left:40px;
}
/*________________Here is the Second Icon________________*/
#twitterIcon{
vertical-align:middle;
color:white;
font-size:3.5em;
-webkit-transition:font-size 0.2s;
-moz-transition:font-size 0.2s;
transition:font-size 0.2s;
}
#twitterinner:hover #twitterIcon{
opacity:1.0;
font-size: 3.5 em
}
#twitterinner {
background:#23dcd5;
border-radius:100px;
height:100px;
width:100px;
margin:0 auto;
text-align:center;
line-height:100px;
-webkit-transition:height 0.2s, width 0.2s, line-height 0.2s;
-moz-transition:height 0.2s, width 0.2s, line-height 0.2s;
transition:height 0.2s, width 0.2s, line-height 0.2s;
}
#twitterinner:hover{
opacity:1.0;
height: 80px;
width:80px;
line-height:80px;
}
#twitterouter{
background-color:Green;
border:5px solid #23dcd5;
height:100px;
width:100px;
border-radius:100px;
display: table-cell;
vertical-align: middle;
opacity:0.7;
}
#twitterouter:hover {
opacity:1.0;
}
I`m a beginner in CSS (1 week of learning) and I saw this hover effect (at the bottom of this page for the Social Icons).
So I tried to make the same hover effect with my limited skills. After a long time I made the same effect with two divs and an Icon.
The Problem is now that:
Im not able to set a margin to any of the "Icons", this means i want a gap between the FacebookIcon and the TwitterIcon so they wont interfere like the FacebookIcon is interfering with the Twitter Icon.
How can I hover over the inner div and activating the hover of the outer div (I can not make the inner div the parent of the outer because the outer has to be bigger than the inner).
I want the FacebookIcon Outer to grow from the center and not like its doing now. (Like in the example in the Webpage mentioned above.
I've searched for this solutions long time and found nothing suitable. Probably there is a much easier way of creating this Icons, this would be another solution :)
Thanks for your advice and sorry for my bad English (German here).
Im not able to set a margin to any of the "Icons"
That's because margin property is not applicable to display: table-cell elements.
How can I hover over the inner div and activating the hover of the
outer div
Well, you need to change your strategy. Set all the necessary CSS declarations on the child (<i> tag) and change the styles on parent:hover i selector.
Here we go:
HTML:
<footer>
<a href="#" class="icon-wrapper">
<i class="icon icon-facebook"></i>
</a>
<a href="#" class="icon-wrapper">
<i class="icon icon-twitter"></i>
</a>
</footer>
CSS:
.icon-wrapper {
float: left;
display: block;
margin: 0 1.875rem;
color: white;
font-size: 5.5rem;
}
.icon-wrapper i.icon {
display: block;
width: 8rem;
height: 8rem;
line-height: 8rem;
border-radius: 50%;
opacity: 0.5;
transition: all .2s;
}
.icon-wrapper:hover i.icon {
opacity: 1;
box-shadow: 0 0 0 1.5625rem green, /* <-- = the parent's background-color */
0 0 0 1.875rem #9b59b6;
}
.icon-facebook {
background-color: #3b5998;
}
.icon-twitter {
background-color: #23dcd5;
}
WORKING DEMO.
I have a site consisting of three articles. I have a couple media queries set up for responsive design, but as I resize, it seems the ul and li elements of the article overflow the article (tested on an iphone5). I can hack around this by setting a height on the article to, say 200%, but would like to avoid this if I can. The CSS behind the article and ul:
#about {
background-color: #ebebeb;
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
#about h1 {
text-align: center;
margin: 0;
padding-top: 3em;
}
#about ul {
display: block;
width: 100%;
margin: 5em auto;
list-style: none;
padding: 0;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
#about ul li {
width: 20%;
float: left;
vertical-align: top;
margin:0 6.6666665%;
font-size: .8em;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
#about ul li img {
display: block;
margin-left: 2em;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
And here is a jsFiddle => http://jsfiddle.net/sKvqF/
It's hard to recreate the effect it's giving without all the necessary code but I'm hoping someone can spot an error in my code somewhere.
I'm not 100% sure, what you are referring to by 'overflow' but if you are floating the list-items, you highly probable want to include a clearfix on your ul, such as:
#about ul:before, #about ul:after { content: ""; display: table; }
#about ul:after { clear: both; }
#about ul { zoom: 1; }
See https://stackoverflow.com/a/6539954/1696030
But be also aware of the high specifity of your CSS selectors, see f.e. http://csswizardry.com/2011/09/when-using-ids-can-be-a-pain-in-the-class/