I am trying to override the css from another file and I would like to know how specific of a reference I would need to override it.
Here is the page I am working with if you'd like to take a look:
http://www.bolistylus.com/shop/
This is what I'm trying to override:
.products li {
float: left;
margin: 0 10px 20px 0;
padding: 0;
position: relative;
width: 150px;
}
Here is the HTML I'm working with:
<div id="main">
<section id="primary"><div id="content" role="main"><div id="breadcrumb"><a class="home" href="http://www.bolistylus.com">Home</a> › Shop</div>
<h1 class="page-title">All Products</h1>
<ul class="products">
<li class="product first">
<a href="http://www.bolistylus.com/shop/boli-2/">
<img width="150" height="150" src="http://www.bolistylus.com/wp-content/uploads/pinkproduct-150x150.png" class="attachment-shop_small wp-post-image" alt="pinkproduct" title="pinkproduct" />
<strong>Boli Pink</strong>
<span class="price">$24.00</span>
</a>
Add to cart
</li> <li class="product ">
</li></ul><div class="clear"></div>
</div></section>
</div><!-- #main -->
.products li has a specificity of (0, 0, 1, 1)
a minimal higher specificity can be created with
ul.products li which has a specificity of (0, 0, 1, 2)
See this jsfiddle: http://jsfiddle.net/DAL9A/
.products li and you can use !important if it doesnt take. Try to load that after what your trying to override.
UPDATE*
Try just using ".product"
Actually just ready your comments. What are you trying to target? The image? If So you should get the width and height out of inline and apply it in CSS
Related
I know this looks very simple, but I have been trying to figure out a solution for an hour now. I have an "a" element with text and an image inside. The problem is that the image goes below the text, and I want them lined up.
a {
text-decoration: none;
color: #fff;
}
a:hover {
color: #ff5c33;
text-decoration: none;
cursor: pointer;
}
#nav-user-logo{
max-height: 16px;
}
<!-- Header right part -->
<div class="dropdown">
<a>
User123
<img src="Images/Icons/user.svg" id="nav-user-logo" alt='User123'>
</a>
<div class="dropdown-content user-dropdown-content" >
<a>AW Admin</a>
<a>Account Settings</a>
<a>Change Password</a>
<a>Logout</a>
</div>
</div>
I didn't have the issue myself but you can do
#nav-user-logo {
max-height: 1em;
display: inline;
}
to guarantee it is inline with the text.
By defect, any browser, with your css will display the image side by side as, I think, you want:
example with your code:
a {
text-decoration: none;
}
a:hover {
color: #ff5c33;
text-decoration: none;
cursor: pointer;
}
#nav-user-logo{
max-height: 16px;
}
<div class="dropdown">
<a>
User123
<img src="https://www.ajvs.com/redirect/5/Agilent_IMG300_UHV_R0343301_1,8926cf9ec9ce009a52f3ea8866b07f5f" id="nav-user-logo" alt='User123'>
</a>
<div class="dropdown-content user-dropdown-content">
<a>AW Admin</a>
<a>Account Settings</a>
<a>Change Password</a>
<a>Logout</a>
</div>
</div>
Probably, you have some kind of "reset" css sheet that is turning all your images as display:block It's quite common in many wordpress themes. You may need to overwrite these css adding img {display:inline-block} or similar rule. Calling to the id image or class to not break your whole theme.
Turns out the issue was something super simple. This code is in a header, on the right side, and the "a" element was too small to display the code and image side by side. I fixed it with the following:
<!-- Header right part -->
<div class="dropdown">
<a style="display:inline-block; width: 150px;">
User123
<img src="Images/Icons/user.svg" id="nav-user-logo" alt='User123'>
</a>
<div class="dropdown-content user-dropdown-content" >
<a>AW Admin</a>
<a>Account Settings</a>
<a>Change Password</a>
<a>Logout</a>
</div>
</div>
How to provide filter to the photo sent for printing. I tried adding the following css.
#media print {
.photo {
img {
filter: brightness(2);
-webkit-filter: brightness(2);
}
}
}
Nothing happens. The brightness of the pictures is same. My application captures the pictures from webcam and sends the base64 image to the server. I am using webcam.js plugin to capture the image.
HTML Code
<a onclick="printpage()" class="btn btn-success" href="#">
<i class="fa fa-print"></i>Print Card
</a> </div>
</div>
</div>
</div>
</div>
</div>
<div id="idCard_print" class="idcard">
<div class="cardinner">
<div class="cardheader">
<div class="image">
<img alt="header logo" width="40px" src="/assets/40xNxcardlogo-7e613bf7d05be0b9d2fe128f14519e11437beaa0d6b40fd2c332b6800059c783.gif.pagespeed.ic.-YOaR880p3.png" data-pagespeed-url-hash="348730017" onload="!window.__cfRl||__cfRl.r(function(){pagespeed.CriticalImages.checkImageForCriticality(this);},this)" />
</div>
<div class="afu-title">
Agriculture and Forestry University
<span>Rampur, Chitwan</span>
</div>
<div class="faculty">
Faculty of Animal Sci., Vet. Sci. & Fisheries
</div>
</div>
<div class="cardtype">
<span>Student ID Card</span>
</div>
<div class="photo">
<div class="student">
<img height="73px" src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/wAARCADmAMgDASIAAhEBAxEB/8QAHQAAAAYDAQAAAAAAAAAAAAAAAAIDBAUIAQYHCf/EAEMQAAEDAgUCBAIIAwYFBAMAAAECAxEABAUGEiExB0ETUWFxCCIJFBUjMoGRoVJiwRYzQnKx0XOCkuHwGCU0Q0XS8f/EABoBAAIDAQEAAAAAAAAAAAAAAAECAAMEBQb/xAAqEQACAgICAgEEAgIDAQAAAAAAAQIRAyEEMRJBUQUTInEyYYGxFEKRof/aAAwDAQACEQMRAD8AvW6swB2rAIgmg4NSh5prCgQjjvSeyp/AVY1J270uy2EpMzzSWnalJIRvzzURGAlJKgeB2pPUEo/OiqKjqjf3oBslAmJpwNKhRuEoMjmkViJPNL7BI8pg0k4BqEUOwpV0Jpkk7wKNr+cA8VlKeTsT2o60J0yOaJNJgSuANqytX3cgTvsKTjjajJgjfaiT0ALKU+lG1ktHuSaTUQAI3HejJWkJmgQUbGttUmkySTExFKtLARvEUmoJB+WiDdh21qBO8Csgbfi3omoBQ37UqynxFmeB3qILQZuAkiJmiKMDYDalEgaQY242NJvK0Exxp3BqMHQyuFkJVJM01B8QnaTSrq9cmNz50gyopPHPY0uyPQffel2zsBPfk0kI8t6csKEgHuaZE0iQtwVHcySaFL20akwmhVlCbYxUrbfmsKWSkdhSSlD5SDRSsjfaJ71QWU/YqJUKMT8v5UklZKh2rKZVqmj6I+tBkJBFHUkhv0msNhOn2o6ogTsKnsnsI4nSge/aknDGnftxSy1AJ8x6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abHkAkD8ya1MmTFB9yVkx7UkhYK6k5W9BQdSgBNIkz6UZwgTvSemJniq7GWwyFwqDtSpIKZpARq86WTuKNkoncI6kZry7ly7y/hOY8VwvBLp/60/YWV2tpp13SE61BJEnSkD8q1+4dXcuqdeWp51W6nHFFSj7k1hQ3/pQCQdqWktj+TqmJaQonegUDvsKPpA2oihI3qAChMcb0VRmjnasTsKhGEUk81mNI9aypXpQKpE96hApE7d6KU6diaMVQfKsbmogMWssQfw27aurS4dtblo6m32FlC0Edwobg1aj4ffpDuofSrFLOzzPfP50yoSEXFveqm7ZR/E07ySOdK5BiNpmqnkCaMnkelGyyM5R6Z6FfSQ9esB6m9Kem+G5fv2r20xDEXsbBROotIYDTaiDxu64IPcHyrz+NESAOOKNI4oK0tuySflsyTA96xNZhJoiiKaxAxVxv+lAc8jzpNO/NZ71CWHnY0KKpUCBQqAF1q1E0QbKHPNChUYEtAc/EPKiJV28qFCo+iIykbA0s2rtQoVEEKofPzQBiDzQoVBWBYmT3pJSiKFCo+hkEPegNzQoVCGFbUIFChVd7CCBHtWNh+dChU9gBooTBiBQoVYAMDANZ1EHmhQokYNRk1gjaaFCg9MCCk1nsKFCh7GMlW/FChQp0FH/2Q==" data-pagespeed-url-hash="3345598353" onload="!window.__cfRl||__cfRl.r(function(){pagespeed.CriticalImages.checkImageForCriticality(this);},this)" />
</div>
<div class="sign">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAyCAMAAACd646MAAACwVBMVEX/AAD/Ghr/ODj/PT3/T0//dXX/hYX/////AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/PT3/AAD/AAD/AAD/AAD/AAD/AAD/AAD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CRyS4hjq2eCSNkXc8D1xImGzj0TXZF0ma8i0RLprdGYUTUBnKSMX9pDcky4JmoDV2cFiZbsL8KSHqaXgUjHUziSC98WEi050+Lq4h6ZV5KVlx7sJA4VXpcMzn6+uBLlUhItUencs3Vic1FuWkJGycJDm8AFOMOuUPwpv4/k1IUMyreCqTVW+C2JosAS4x3XIe2pFGX8lvCQYQm3tJJHZPHEfatLRYkvLEiyRHLWtpULZjfkR9oIklQikWSJgB15PV3yI37UkoG3xGI0uEaoJQAVaC1AVgVO3wAAAABJRU5ErkJggg==" alt="Sardha" data-pagespeed-url-hash="2948073300" onload="!window.__cfRl||__cfRl.r(function(){pagespeed.CriticalImages.checkImageForCriticality(this);},this)" />
</div>
</div>
<div class="clearfix"></div>
<div class="details">
<ul>
<li><span>Name:</span> Roshan Gyawali</li>
<li><span>Address:</span> Rupandehi, Siyari - 7</li>
<li><span>Date of Birth:</span> 2017-11-07</li>
<li><span>Level:</span> B. V. Sc. & A.H.</li>
<li><span>Year:</span> 2013-2019</li>
</ul>
</div>
<div class="barcode">
<p>90432635</p>
<img class="img-responsive" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPgAAABIAQAAAADzYAXTAAAABGdBTUEAALGP
C/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUw
AADqYAAAOpgAABdwnLpRPAAAAAJiS0dEAAHdihOkAAAACXBIWXMAAABIAAAA
SABGyWs+AAAAQklEQVRIx2P4jx8wtFX+Y59R+SDx4fPG9hlycuwzKiQfPmNv
Y5+XkCBRx5Y4Kj8qPyo/Kj8qPyo/Kj8qP+jkCbRvABzvCT9bo5chAAAAAElF
TkSuQmCC
" data-pagespeed-url-hash="3905847029" onload="!window.__cfRl||__cfRl.r(function(){pagespeed.CriticalImages.checkImageForCriticality(this);},this)" />
</div>
<div class="expiry">Expiry: Jan 01, 2019</div>
<div class="url">www.afu.edu.np</div>
</div>
</div>
<style>#media print{aside#sidebar,header[role="banner"],footer,#comments,#respond,header{display:none}#sidebar-wrapper,.header,table,.head,.container-fluid,#topNav,#idCard,.widget,.content-wrapper{display:none}.btn{display:none}.margin-top,.panel{display:none}body{content:asset-url("card-backgroundafu.png")}*{color:#000;// #include box-shadow(none);// #include text-shadow(none);-webkit-print-color-adjust:exact!important;color-adjust:exact!important}#page-wrapper.open{padding:0;height:0;margin:0}#page-wrapper .sidebar-footer{display:none}#page-wrapper ul.sidebar{display:none}#page-wrapper #sidebar-wrapper{display:none}#idCard_print{display:block;position:relative;background-color:#fff!important;margin:0;padding:0}#idCard_print .cardinner{padding:0}#idCard_print .cardinner .cardheader{font-size:11px;text-align:center;height:84px;line-height:11px;background-color:#deefe3!important;font-family:"Helvetica",sans-serif}#idCard_print .cardinner .cardheader .afu-title span{font-size:9px;line-height:9px;display:block}#idCard_print .cardinner .cardheader .faculty{font-size:10px;text-transform:uppercase;font-family:'',sans-serif;font-weight:700;line-height:11px;margin-top:2px}#idCard_print .cardinner .cardtype{font-family:'Helvetica',sans-serif;text-align:center;color:#fff!important;background:#8dc349!important;width:100%;margin:0 auto;font-size:11px}#idCard_print .cardinner .cardtype span{border-left:2px solid #fff!important;border-right:2px solid #fff!important;border-radius:10px;padding:2px 20px;color:#000!important}#idCard_print .cardinner .photo{height:77px;position:relative;margin-top:3px}#idCard_print .cardinner .photo .student{text-align:center}#icCard_print .cardinner .photo .student img{border:2px solid #ccc;border-radius:10px;filter:brightness(2);-webkit-filter:brightness(2)}#idCard_print .cardinner .photo .sign{margin:0 auto;top:50px;position:absolute;left:61px}#idCard_print .cardinner .photo .sign img{width:50px}#idCard_print .cardinner .photo .dean{text-align:center;font-size:10px;font-family:'Ubuntu',sans-serif;margin-top:5px;font-weight:800}#idCard_print .cardinner .details ul{list-style:none;text-align:center;margin:0;padding:0;font-size:10px;font-family:'Ubuntu',sans-serif;line-height:13px}#idCard_print .cardinner .details ul li span{font-weight:800}#idCard_print .cardinner .barcode img{width:50%;margin:0 auto}#idCard_print .cardinner .barcode p{font-family:'Ubuntu',sans-serif;font-size:9px;letter-spacing:3px;text-align:center;margin:10px 0 0 0}#idCard_print .cardinner .url{font-size:11px;text-align:center;font-family:'Ubuntu',sans-serif;background:#8dc540!important;color:#000!important}#idCard_print .cardinner .expiry{font-size:9px;font-weight:600;text-align:center;font-family:'Ubuntu',sans-serif;color:red!important}#idCard_print:before{content:"";background-image:asset-url("card-backgroundafu.png")!important;background-repeat:no-repeat;background-position:center center;content:' ';display:block;position:absolute;left:0;top:0;width:100%;height:100%;z-index:1;opacity:.1}#page { size: 53.98mm 85.60mm; margin: 0mm; }}</style>
</div>
From what I can see the only problem is that you seem to be using SASS like syntax for your CSS.
#media print {
.photo {
img {
filter: brightness(2);
-webkit-filter: brightness(2);
}
}
}
If this is raw CSS then you need to clean up the syntax to match this:
#media print {
.photo img {
-webkit-filter: brightness(2);
filter: brightness(2);
}
}
Remember to always put the vendor specific styles before the generic styles. So I moved the -webkit-filter before filter
I created a local page on my machine and emulated printing and the CSS does apply with the change above.
Also consider adding a specific class to each of the images to help improve your CSS rules.
Instead of this:
#icCard_print .cardinner .photo .student img{
border:2px solid #ccc;
border-radius:10px;
filter:brightness(2);
-webkit-filter:brightness(2)
}
You could simplify it to this:
.student-img{
border:2px solid #ccc;
border-radius:10px;
filter:brightness(2);
-webkit-filter:brightness(2)
}
with the html for that image tag being this:
<img class="student-img>
And then move the height:73px into the CSS instead of in the style attribute.
Consider using a BEM styled css and you can see a good simplification/reduction in all your CSS rules.
Also, I always use !important for everything I have in the #media print block. This is the only place I allow myself to use !important but I use it on everything just to make sure I have proper specificity of the CSS.
Look here for how to emulate print mode in Chrome
I have an image and text both with links inside of a <li> tag. The <ul> is styled to create columns out of the images and content.
Question: How do I center the copy under the image and add a small margin below the image to give it some separation?
HTML:
<ul class="display-posts-listing">
<li class="listing-item one-fourth first">
<a class="image" href="http://websitex.com/sept-15-2014/">
<a class="title" href="http://websitex.com/sept-15-2014/">Sept 15, 2014</a>
</li>
</ul>
CSS:
ul.display-posts-listing li img{display:block;margin:0px auto;}
ul.display-posts-listing li a.title{margin:0px auto;font:bold 14px arial;margin-top:30px;color:white;text-decoration:none;}
ul.display-posts-listing li a.title:hover{color:orange;}
In order to center text try using the following CSS code.
text-align:center
Adding margin to the bottom of the image should give you the separation you're seeking. Alternately the margin-bottom property can be used.
margin: 0 0 10px 0;
example:
ul.display-posts-listing li .img{display:block;margin: 0 0 10px 0;}
ul.display-posts-listing li a.title{margin:0px auto;font:bold 14px arial;margin-top:30px;color:white;text-decoration:none;text-align:center;}
both your HTML aqnd CSS are weird, change it to this:
<div class="container mainbody">
<ul class="display-posts-listing">
<li class="listing-item one-fourth first">
<img class="image" src="http://i.stack.imgur.com/OrkwY.jpg?s=128&g=1" alt="" />
<a class="title" href="http://websitex.com/sept-15-2014/">Sept 15, 2014</a>
</li>
</ul>
and CSS to something like this:
ul{width:200px;}
ul{width:200px; text-align:center; list-style-type:none}
li img{display:block;margin:0px auto; margin-bottom:20px;}
ul li a{margin:0px auto;font:bold 14px arial;margin-top:30px;color:#f00;text-decoration:none;}
ul.display-posts-listing li a.title:hover{color:orange;}
See fiddle here
i note you use
<a class="image" href="http://websitex.com/sept-15-2014/">
in this way i think your css code should be a.image
ul.display-posts-listing li a.image{display:block;margin:0px auto;}
or also,, make big <li> with position:relative and text position:absolute;
you can control it's position by ex: top:10px;right:10px; and other side
I am designing a website and I want the footer to have two small images on the bottom left side followed by #* (a twitter address). In the middle of the footer I want the address and on the right of the footer I want the contact number.
At present I have all of the above in the footer div however they are not all aligned. The images are very far apart and the text is in the wrong place. The text is below the images and to the right. However I want everything to be aligned horizontally.
I am using HTML and CSS on macromedia dreamweaver.
The current code is:
<div class="footer content">
<ul>
<li> <img src="Images/facebook.png" /> <img src="Images/twitter.png" /> </li>
<li>#TWITTERADRESS</li>
<li>POSTAL ADDRESS </li>
<li>TEL NUMBER</li>
</ul>
</div> <!--end of footer-->
CSS
.footer {
text-align:centre;
background-color:#C8C8C8;
color:#000000;
padding-bottom:1em;
}
First of all edit the CSS as
.footer ul li {
display: inline; // in a straight line
}
Edit the HTML part as:
<div class="footer">
<ul>
<li class="image"><img src="Images/facebook.png" />
<img src="Images/twitter.png" /></li>
<li class="twitter">#TWITTERADRESS</li>
<li class="address">POSTAL ADDRESS </li>
<li class="number">TEL NUMBER</li>
</ul>
</div>
Edit the CSS part now as:
.image {
float: left; // float to the left
}
.number {
float: right; // float to the right
}
Try it here: http://jsfiddle.net/afzaal_ahmad_zeeshan/6zYeA/
maybe something like this:
.footer {
text-align:centre;
background-color:#C8C8C8;
color:#000000;
padding-bottom:1em;
}
.footer li{
float: left;
width: 25%;
}
From the designer point of view... with Photoshop, Illustrator, Freehand or similar you can design a beautiful footer, or better a beautiful draft of the entire page first, the very one you would like to see. Then, start with the markup skeleton writing sections like this (html5):
<div id="wrapperdiv">
<header>
<nav>
<ul>
<li><a href='#'>home</li>
<li>...
<li><a href='#'>contact</li>
</ul>
</nav>
</header>
<section><blockquote>...</blockquote>...</section>
...
<footer>
<img src='.../footerLogo_left.png' id='footerLogo_left'>
<img src='.../footerMiddle_text.png' id='footerMiddle_text'>
<img src='.../footerLogo_right.png' id='footerLogo_right'>
</footer>
</div>
At this point we can write the CSS3 code (maybe at styles.css):
...
#wrapperdiv {background...}
header {width...}
nav li a{...}
...
footer{
width:...;
height:...;
margin:...;
}
Next thing to do is to cut images from the draft, like footer_bg.png, footerLogo_left.png, footerLogo_right.png, footerMiddle_text.png..., and link them to the markup:
footer{
background:url(.../footer_bg.png) repeat_x;
width:...;
height:...;
margin:...;
}
#footerLogo_left {
float:left;
margin:...}
#footerMiddle_text {
float:left;
margin: (the same than left)}
#footerLogo_right {
float:right;
margin: (the same than left)}
Ok, it's not as easy as it seems, but this way can give you very visual websites (graphical draft + html skeleton + css styles).
A few days ago I was working on a classic menu. It has a logo on the left and some menu buttons on the right. This was my first try – fiddle1. But someone from this community told me that menus normally aren't coded like that but with <ul>and <li>.
So I tried to rebuild that menu – fiddle2. Unfortunately nothing works.
My first issue is that I have the feeling that the <div id="menubuttons"> is not located IN the <div id="header">. The second problem is that <div id="menubuttons" align="right"> isn't aligned right as it should be.
Can you help me to get the visual result of fiddle1 with <ul>and <li> tags?
ul element by default will take margin
So please add css like this, it will remove the default margin and padding
ul{margin:0; padding:0}
#menubuttons { float:right}
Check this Demo
I changed some code, try this:
http://jsfiddle.net/WnneG/
<ul style="float:left;paddin:0px;margin:0px;">
<li class="menubutton"> Home
</li >
<li class="menubutton"> Info
</li>
<li class="menubutton"> Spenden
</li >
<li class="menubutton" align="right" style="margin-right: 20px;"> Kontakt & Impressum
</li >
</ul>
replace this line of code:
<div id="header_logo" align="left">
<img src="http://futurized.t15.org/fut_logo.png" style="height: 12px; z-index: 2;" />
</div>
<div id="header_menu" align="right">
with:
<div id="header_logo" style="float:left;">
<img src="http://futurized.t15.org/fut_logo.png" style="height: 12px; z-index: 2;" />
</div>
<div id="header_menu" style="float:right;">
hopefully you will get your desired result if this help You please mark it as green
See the code in the fiddles you posted. Yours tries to create a menu from divs, while the one you are trying to get to, has <li> items with float: left;
Put to <li> tag style display:block;float:right; like this: <li style="display:block;float:right">
Use float = right instead of align for the div menubuttons.
#menubuttons {
margin-right: 0;
margin-top: 0;
height: 2.5em;
line-height: 2.5em;
display: block;
float:right;
}
I have created a version of your menu. I think this helps: http://jsfiddle.net/yBTJF/4/
.menu
{
height: 30px;
background: #FFFFFF;
line-height: 30px;
list-style: none;
padding: 0 5px;
margin: 0px;
}
If you want :hover, all you have to do is create a selector in your CSS:
.menu a:hover
{
// ...
}