html adding borders - html

I would like to add some right-positioned borders to my menu.
But the ones that I can use by default are not working for me. Can anyone recommend where to get a bit better looking borders, and how i add them in the css?

the css style you need :
#mymenu
{
border-right:solid 50px red;
}

You could try using jQuery (its more shape than actual border)
There's also a set of jQuery plugins to use on top of that.
Finally, there are some nice and easy css3 border properties that you could use.
I hope this helps.

Related

Background Image with fix size

Hi please check the photo below, what im doing is i want to have a background image below the slider with the fix size
Css Code
.swiper-slider-bg {
background: url('http://localhost/wordpress/wp-content/uploads/2017/11/bg-08-1.png');
background-size: auto 100%;
}
Current code
What I need to have
Define it in pixels instead of percentage. Or, as a much flexible alternate, you may also use pseudo to achieve the same.
:before or :after selector shall be useful for you. I am hoping that you know how to use these selectors so not explaining that stuff.
I think this is you need to want, refer below links for your use, It will be use your full page image slider.
https://www.w3schools.com/w3css/tryit.asp? filename=tryw3css_slideshow_self
https://codepen.io/jibbon/pen/BoisC

selecting all elements which are styled with a css gradient

I'm looking for a way, using only modern css, to select all elements which have a background-image which utilizes any sort of gradient and then overwrite that value with 'none'. Essentially, I need to wipe out all background gradients. This is what I have so far but it doesn't seem to work:
*[background-image*="gradient"]{
background-image: none !important;
}
I'm starting to think that attempting something like this is not sane, but I'd like to know for sure. Is this even possible? If so, what am I doing wrong?
You cannot solve this problem using HTML and CSS.
You could use Javascript to check the background-image of every element in the DOM. With a huge DOM this can become slow, but seems like you have no other choice.
How about this method. you only have to add the class gradient for all those elements which are using gradient effect. I understand its a bit of work but it will solve your problem.
*[class*='gradient'] {
background-image: none;
}

CSS - how to create these separators?

I have a css homework to copy exactly a web site. I've done about 80% of my work but there're still some elements in the original website that i can't bring to my copy, for example, these separators:
I've tried some ways on the Internet but none of them seems to work with my current situation.
This is my work until now: https://dl.dropboxusercontent.com/u/178536659/xin/index.html.
Besides that, my teacher provided us some resources (included logos, images etc... to make a copy of the website). It includes some transparent-only horizontal rectangle images. I dont' know what it is used for ... Is it use for make these separators, i guess ?
So I hope you guys could help me with this ... any comments would be appreciated. Thanks so much in advanced !
They are simple borders, such as
ul#nav_menu li {
border-right: 1px solid #cecece;
}
Now remove the border of the first child from the element using some class or id and setting no border to it! Simple.
There are many ways to create vertical separators, the most common border-left/border-right or pseudo elements :before and :after, horizontal separators are made with <hr> tag.
Borders documentation:
http://www.w3schools.com/css/css_border.asp
Here are some good examples with pseudo-elements (which you can use with your images):
http://krasimirtsonev.com/blog/article/CSS-before-and-after-pseudo-elements-in-practice
You can also create divs, give them css properties to emulate a separator and place them in between or use images.
Use this in your CSS. I think it will work for you.
#header ul li{border-right:2px solid #d8d8d8;}#header ul li:last-child{border:none;}

How to make pure css floating tooltips (absolutely positioned span) dynamically resize to accommodate text

I recently had an idea for using the CSS pseudo-class :hover to display a styled tooltip when the mouse is hovered over a link.
The basic code for the link looks like this:
.hasTooltip {
position:relative;
}
.hasTooltip span {
display:none;
}
.hasTooltip:hover span {
display:block;
background-color:black;
border-radius:5px;
color:white;
box-shadow:1px 1px 3px gray;
position:absolute;
padding:5px;
top:1.3em;
left:0px;
max-width:200px; /* I don't want the width to be too large... */
}
This link has a tooltip!<span>This is the tooltip text!</span>
The result is exactly what I want, but with one annoying problem: the span does not expand to accommodate text, and if I don't specify a width, the text is squashed.
I did some searching on Google, found a couple examples of work people had done (this example is creepily similar to what I've gotten), but no one seems to have addressed the span width problem I'm having.
I know this answer is extremely late, but it appears the key to your issue would be to use:
white-space: nowrap;
inside of your span, and get rid of any sort of width definition. Of course the drawback to this will be that the tooltip will only be able to support a single line. If you want a multiline solution you will most likely have to use javascript.
Here is an example of of this method:
http://jsbin.com/oxamez/1/edit
An added bonus is that this works all the way down to IE7. If you do not need to support IE7, I would suggest folding the span, and img styles into a :before, and :after for the .tooltip. Then you can populate the text using the data-* attribute.
I don't think there's a perfect solution to this problem with pure CSS. The first problem is that when you place the span inside the a tag the span only wants to expand as far as the width of the link. If you place the span after the the a it's possible to get close to what you're trying to do but you'll have to set the margin-top: 1.3em and then have to set a negative margin to slide the tooltip left. However, it's going to be a fixed setting so it won't sit exactly at the start of each link.
I whipped up a jQuery solution that sets left dynamically (and a nice little fade effect for good measure).
Demo: http://jsfiddle.net/wdm954/9jaZL/7/
$('.hasTooltip').hover(function() {
var offset = $(this).offset();
$(this).next('span').fadeIn(200).addClass('showTooltip');
$(this).next('span').css('left', offset.left + 'px');
}, function() {
$(this).next('span').fadeOut(200);
});
These tool tips can also be integrated into a word press theme easily. Just copy the CSS into your style. Css file and when creating your posts, just take help of the HTML code and create your own tool tips. Rest is all styling, which can be altered according to your own choice. You may also use images inside the tool tip boxes.
http://www.handycss.com/how/how-to-create-a-pure-css-tooltip/
Even though this question is a bit older already, I would suggest the following compromise:
Just use max-width: 200px; and min-width: 300%; or so,
whereas the min-width could result higher than the max-width.
Just figure it out.
This way you could not have entirely liquid tooltips but the width would stand in kind of a correlation with the width of the containing link element.
In terms of optical pleasantness this approach could be of value.
edit:
Well I must admit it is nonsense what I wrote. When the min-width can be higher than the max-width, there is no sense to it.
So just putting the min-width in percent would achieve what I tried to suggest.
Sorry for that.
I found this and it was working for me. It's a good solution when you have a lot of elements and jquery plugins on the same page and you can't work with
Text <span>Tooltip</span>
View pure CSS solution: JS BIN
Credit to trezy.com

Is it possible to achieve a row highlighting effect without javascript?

I want the "tr" that's currently hovered over to change color, and then change back when the mouse is no longer over it. Is this possible using pure CSS, or is javascript the only solution? (I currently have a javascript solution, so I don't need examples of that)
Thanks!
Yes, this is possible in CSS. The example below will have a red background normally, and a green background when the row is hovered over.
tr td { background: #f00; }
tr:hover td { background: #0f0; }
However, it should be noted that this will not work in IE6, as it does not understand the ":hover" pseudo class on any elements other than <a>.
I believe that javascript is the only solution that will provide cross-browser support.
I think you can use :hover css attribute.