I want to insert an image in CSS bubble, the code is correct but nothing appears,
can you please check how to solve this one
.triangle-isosceles {
position: relative;
padding: 15px;
margin: 1em 0 3em;
color: #000;
background: #f3961c;
-moz-border-radius: 50px;
-webkit-border-radius: 50px;
border-radius: 50px;
/*border-radius: 10px;*/
background: linear-gradient(top, #f9d835, #f3961c);
}
now before
.triangle-isosceles:before {
content: "";
display: block; /* reduce the damage in FF3.0 */
position: absolute;
bottom: -15px;
left: 50px;
width: 0;
border-width: 15px 15px 0;
border-style: solid;
border-color: #f3961c transparent;
}
the last one is after
.triangle-isosceles:after{
content: url("/web/resources/images/paul.png");
display: block;
position: absolute;
bottom: -130px;
left: 12px;
width: 110px;
height: 110px;
border:0;
background: #3365d4;
-moz-border-radius: 70px;
-webkit-border-radius: 70px;
border-radius: 70px;
}
In the "after" version, you have two errors:
content: This is not the correct tag to specify the background, the correct one would be simply "background"
background: As you may figure by reading the first error, the background property you have defined is the one who is specifiying the background. This tag has to be removed as it will be overwritten if is not deleted.
So the CSS should loke like this:
.triangle-isosceles:after {
background: url("/web/resources/images/paul.png");
display: block;
position: absolute;
bottom: -130px;
left: 12px;
width: 110px;
height: 110px;
border:0;
-moz-border-radius: 70px;
-webkit-border-radius: 70px;
border-radius: 70px;
}
You should also consider to add compatibility with more browsers. You can find more information at this page: https://www.w3schools.com/cssref/css3_pr_background-size.asp
EDIT: This is an example of a working CSS tag that add a background image to a "div":
#headerwrap {
background: url(../images/homepage/header.jpg) no-repeat center top;
margin-top: 60px;
padding-top: 20px;
text-align: center;
background-attachment: relative;
background-position: center center;
min-height: 600px;
width: 100%;
-webkit-background-size: 100%;
-moz-background-size: 100%;
-o-background-size: 100%;
background-size: 100%;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
Hope this helps :)
You need to add content also, Without content after and before won't work
Like this :
.triangle-isosceles:after {
content :'';
background: url("/web/resources/images/paul.png");
display: block;
position: absolute;
bottom: -130px;
left: 12px;
width: 110px;
height: 110px;
border:0;
-moz-border-radius: 70px;
-webkit-border-radius: 70px;
border-radius: 70px;
}
Related
I'm designing my website, and I have a problem with the positioning a box, in CSS. When you see it from the desktop it looks good, but at the moment of the phone it is not totally responsive, nor centered. I do not understand what is wrong with my code.
HTML
<div class="cuadrado">
<div class="franja">
<h1>Mario</h1>
<h4>Web Developer</h4>
</div>
CSS
.cuadrado {
position: relative;
display: block;
margin-left: auto;
margin-right: auto;
margin-top: 50px;
background-attachment: fixed;
background-color: #f7f7f7;
height: 500px;
width: 462px;
border-radius: 8px 8px 8px 8px;
-moz-border-radius: 8px 8px 8px 8px;
-webkit-border-radius: 8px 8px 8px 8px;
border: 0px none #000000;
}
.foto {
position: relative;
left: 190px;
top: -125px;
height: 100px;
width: 100px;
background-repeat: no-repeat;
background-position: 50%;
border-radius: 50%;
background-size: 100% auto;
}
.franja {
position: relative;
top: 62px;
height: 150px;
width: 100%;
background-color: #EFF2F2;
}
Here you can see it online: https://mariomuratori.github.io/contact
Thanks for the help!
The reason it doesn't look as good on your phone is because you're using static pixels, and the resolution on your phone is not the same as your monitor.
You can try checking out a tutorial like this for help to make it responsive on both devices:
https://www.w3schools.com/html/html_responsive.asp
so basically i made a child theme of color mag and copied the buddy press css into my child theme like this /buddypress/css/buddypress.css (this is what they told in the forums)
so from this
#buddypress #header-cover-image {
background-color: #c5c5c5;
background-position: center top;
background-repeat: no-repeat;
background-size: cover;
display: block;
left: 0;
margin: 0;
padding: 0;
position: absolute;
top: 0;
width: 100%;
z-index: 1;
}
i added this
#buddypress #header-cover-image {
background-color: #c5c5c5;
background-position: center top;
background-repeat: no-repeat;
background-size: cover;
border-style: solid;
border-color: black
display: block;
left: 0;
margin: 0;
padding: 0;
position: absolute;
top: 0;
width: 100%;
z-index: 1;
}
enter image description here
am i doing something wrong??
You are missing ; at end of border-color: black. This could be the problem
What am I doing wrong? No picture is showing up at all. :-/ (fyi I cut off the bottom of the code, the tags are all completed I promise)
On all the tutorials I looked at they did this very thing and it showed the whole picture. But when I do it it doesn't show anything. If I type text inside the a href tags it shows part of the picture behind the text, but nothing otherwise.
CSS:
body {
background-color: #ebf4f7;
background-image: url(bg.png);
background-repeat: repeat-x;
}
#mainnav {
position: relative;
top: -9px;
left: -2px;
width: auto;
padding-right: 0%;
padding-left: 0%;
}
.profilebutton {
background-image: url(button%20profile.png);
background-position: 0px 0px;
height: 71px;
width: 113px;
}
.profilebutton:hover {
background-image: url(button%20profile.png);
background-position: 0px 100%;
height: 71px;
width: 113px;
}
HTML:
<nav id="mainnav">
<a> is an inline element, so you have to give the property display: block; to your <a> element if you aren't going to add any text: Fiddle
.profilebutton {
display:block;
background-image: url('http://placekitten.com/300/303');
background-position: 0px 100%;
height: 71px;
width: 113px;
}
body {
background-color: #ebf4f7;
background-image: url('http://placekitten.com/300/301');
background-repeat: repeat-x;
}
#mainnav {
position: relative;
top: -9px;
left: -2px;
width: auto;
padding-right: 0%;
padding-left: 0%;
}
.profilebutton {
display:block;
background-image: url('http://placekitten.com/300/302');
background-position: 0px 0px;
height: 71px;
width: 113px;
}
.profilebutton:hover {
display:block;
background-image: url('http://placekitten.com/300/303');
background-position: 0px 100%;
height: 71px;
width: 113px;
}
<nav id="mainnav">
nbvnbvnchdfg
I have seen this, but it does not provide any solution to my programming issues:
Custom cursor to entire page
This is the CSS Markup:
body {
height: 100%; width: 100%; padding: 0; margin: 0;
background: #000 url('http://1hdwallpapers.com/wallpapers/undead_dragon.jpg') no-repeat fixed center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover; font-size:12px; font-weight:bold;
cursor: url('http://www.rw-designer.com/cursor-view/21962.png'), auto;
}
div#mask {
cursor: not-allowed;
z-index: 999;
height: 100%;
width: 100%;
}
a:link {
color: #ffffff;
font-weight: normal;
text-decoration: none;
}
a:visited {
color: #ffffff;
font-weight: bold;
text-decoration: line-through;
}
a:active {
color: #F433FF;
font-weight: normal;
text-decoration: blink;
}
a:hover {
color: #F433FF;
font-weight: bold;
text-decoration: blink;
}
#about_me
div.center {
margin-left: auto;
margin-right: auto;
width: 8em;
}
{
width: 355px;
float: right;
margin: 20px 0px 0px 0px;
}
.contentTitle {
color: #fff;
background: #000;
}
.contentModule {
color: #FF00FF;
border: 1px solid transparent;
background: transparent;
cursor: pointer;
}
#right_column {
float: left;
width: 355px;
margin: 20px 0 0 20px;
}
#left_column {
width: 210px;
margin-bottom: 10px;
margin-right: 0px;
float: left;
}
#pet_panel {
position: absolute;
top: 80px;
right: 700px;
margin-top: 50px;
width: 40%; float: left; margin: 0 0 20px 0;
}
#comment_panel {
position: absolute;
top: 700px;
right: 85px;
margin-top: 50px;
}
#tombstone_panel {
position: absolute;
top: 30px;
right: 85px;
margin-top: 50px;
}
#user_panel {
position: absolute;
top: 30px;
right: 385px;
margin-top: 50px;
}
#wishlist_panel {
position: absolute;
top: 250px;
right: 85px;
margin-top: 50px;
}
This is the HTML Markup:
<div id="about_me" class="contentModule">
<div class="contentTitle">About Me</div>
<div class="contentModuleI">my tagline </div>
</div>
What can I do to make my custom cursor visible throughout my page like the default cursor is?
If you need to display custom cursor on full page you have to add CSS like this. Have a look at DEMO.
body, html
{
height: 100%;
width: 100%;
padding: 0;
margin: 0;
background: #000 url('http://1hdwallpapers.com/wallpapers/undead_dragon.jpg') no-repeat fixed center;
cursor:url('http://www.rw-designer.com/cursor-view/21962.png'), url('cute25.cur'), help;
}
so here explain how it works; Firefox and chrome are fine with .jpg or .png file extension. But to support in IE need a .cur file extension. You may convert your image into .cur extension. from this online tool.
Note: If you need it work also in IE then you have to use cursor .cur file extension.
I've been trying to create a small social media bar for my website.For some reason which I can't work out the images which I want to use to create a sprites won't load. I should also mention that I have had similar problems with background-image not displaying.
HTML call is this:
<div id="socialbar">
<div class="plus">Google Plus</div>
<div class="twitter">Twitter</div>
<div class="facebook">Facebook</div>
<div class="youtube">YouTube</div>
<div class="flickr">Flickr</div>
</div>
CSS looks like this:
#socialbar
{
width: 245px;
margin: 0px;
display: inline;
border: 0px;
}
#socialbar a.plus
{
display: block;
float: left;
height: 32px;
width: 32px;
text-indent: -9999px;
background-image: url('http://www.mediafire.com/conv/9452d5f77f6e5e7e91294b54b9a74d18029cbeae2075ef9d12787e7631f849226g.jpg');
background-position: 0px 0px;
margin-left: 5px;
margin-right: 5px;
}
#socialbar a:hover.plus
{
background-image: url('http://www.mediafire.com/conv/9452d5f77f6e5e7e91294b54b9a74d18029cbeae2075ef9d12787e7631f849226g.jpg');
background-position: 0px -32px;
}
#socialbar a.twitter
{
display: block;
float: left;
height: 32px;
width: 32px;
text-indent: -9999px;
background-image: url('http://www.mediafire.com/conv/d2133ecf83fc76b78008ed1357a8fb8213e6c2300c26f6af3b1758c576ed17db6g.jpg');
background-position: 0px 0px;
margin-left: 5px;
margin-right: 5px;
}
#socialbar a:hover.twitter
{
background-image: url('http://www.mediafire.com/conv/d2133ecf83fc76b78008ed1357a8fb8213e6c2300c26f6af3b1758c576ed17db6g.jpg');
background-position: 0px -32px;
}
#socialbar a.facebook
{
display: block;
float: left;
height: 32px;
width: 32px;
text-indent: -9999px;
background-image: url('http://www.mediafire.com/conv/df04514676d02be959e52f440b9c10e82d09eefdb82d34fdd336a896be551d026g.jpg');
background-position: 0px 0px;
margin-left: 5px;
margin-right: 5px;
}
#socialbar a:hover.facebook
{
background-image: url('http://www.mediafire.com/conv/df04514676d02be959e52f440b9c10e82d09eefdb82d34fdd336a896be551d026g.jpg');
background-position: 0px -32px;
}
#socialbar a.youtube
{
display: block;
float: left;
height: 32px;
width: 32px;
text-indent: -9999px;
background-image: url('http://www.mediafire.com/conv/6de4cbb7ecf8e81a25e0ebe35e2cb82af5859b4b2cb3ac9c3ec2fe8c62348c296g.jpg');
background-position: 0px 0px;
margin-left: 5px;
margin-right: 5px;
}
#socialbar a:hover.youtube
{
background-image: url('http://www.mediafire.com/conv/6de4cbb7ecf8e81a25e0ebe35e2cb82af5859b4b2cb3ac9c3ec2fe8c62348c296g.jpg');
background-position: 0px -32px;
}
#socialbar a.flickr
{
display: block;
float: left;
height: 32px;
width: 32px;
text-indent: -9999px;
background-image: url('http://www.mediafire.com/conv/dbab33ccef1c60b2974d10a0323f7bb04f594f3b57468dc1a7be8551eb9d1b176g.jpg');
background-position: 0px 0px;
margin-left: 5px;
margin-right: 5px;
}
#socialbar a:hover.flickr
{
background-image: url('http://www.mediafire.com/conv/dbab33ccef1c60b2974d10a0323f7bb04f594f3b57468dc1a7be8551eb9d1b176g.jpg');
background-position: 0px -32px;
}
Your find my code here also:
http://jsfiddle.net/Yx8tT/122/
(Please note that i am using another host for this as the host for my website does not allow direct links to images etc for anything other than my actual website)
And the site in question being:
http://www.darrenlumber.co.uk
Thanks inadvance!
You aren't applying your css to the plus elements.
<div class="plus">Google Plus</div>
#socialbar a.plus
{
display: block;
float: left;
height: 32px;
width: 32px;
text-indent: -9999px;
background-image: url('http://www.mediafire.com/conv/9452d5f77f6e5e7e91294b54b9a74d18029cbeae2075ef9d12787e7631f849226g.jpg');
background-position: 0px 0px;
margin-left: 5px;
margin-right: 5px;
}
The selector should be:
#socialbar .plus a
and so on for each of the others.