I made an svg image for on my site. When I use it though it looks like this:
There is alot of transparent area around it where I would say it could expand.
There doesn't seem to be any transparent area in the svg image itself.
When I use a png it works fine, just with the svg it creates this blank area.
I just gave the image a red background to see where the image actually is.
This is my css:
#logo {
position: absolute;
left: 0;
top: 0;
background-color: red;
width: 200px;
height: 50px;
}
#logo directs to the <img> in my html:
<img src="Sources/FruityJuice Logo.svg" alt="FruityJuiceLogo" id="logo">
In Adobe Illustrator I cropped the file to the logo like Yong Pin said and that seems to have fixed it.
Related
I have this circle gradient in the top right corner of this webpage but I actually want this to come over the image.
Currently, I have this:
Whereas, I want this to be like here:
Here is my css code for the top-right-gradient:
.top-right-gradient{
position: absolute;
top: -40%;
right: -14%;
width: 800px;
height: 800px;
border-radius: 50%;
background: linear-gradient(#ee9ca7, #ec4357);
}
Simply make sure your image is a PNG file with a transparant background, or an SVG file without a background fill.
This is how to original image look like:
And here is how to show it on website:
My question is why to change the black colour between the original image and the image which showed on website, and what can I do to avoid it?
Here is how to call the image on HTML:
<img id="logo" src="Photo/my-logo.png" alt=""/>
Here's how to call the image on CSS:
#logo {
display: block;
margin: 0;
position: absolute;
top: 2%;
float: left;
width: 15%;
left: 0%;
color: #101010;
}
The original image has 805px x 204px, therefore when write width: 100%; it to come many place from Monitor... .
I to try with Gimp the image to scaling, what the image to come is similar as the second image...
With Gimp scaling the image to 265px x 67px, how to show it...
how to show the image later the scaling
When give width: 100%; come same problemm..
I found the solution!, ..the verity, was on other Forum that people to say to me...
1. In Gimp do Filters > Generic > Erode , this will thicken up the black ,
how to show later this step
2. scale with Gimp the image to 265px 67px.
3. how it to show the logo on the Website..
how to show on the website
I would like to place a smaller image with a transparent background in front of a header image in WordPress. The theme I am currently using allows me to set own css styles but I have no clue how to achieve my goal.
Has anybody already worked on this?
Thanks a ton,
Anton
Here is an example how to place an image in front of another image. I placed a PNG of a bee inside a banner image.
HTML
<div id="container">
<img id="banner" src="https://www.mortcap.com/images/sample_report_banner.png">
<img id="bee" src="https://orig00.deviantart.net/672c/f/2014/320/3/1/bee_png_stock_by_karahrobinson_art-d86m7bq.png">
</div>
CSS
#container {
position: relative;
}
#banner {
width: 600px;
}
#bee {
position: absolute;
z-index: 5;
top: 20px;
left: 20px;
width: 100px;
}
When we set position: absolute, that element will always be position relative to the nearest parent with position: relative (or absolute). And then you can refine the position of the absolutely positioned element using top, bottom, left, right css properties.
Play arround with this fiddle
how to crop an image in html? I have an image on server-pc, is it possible to put only a cropped portion on my webpage without explicitly cropping and creating a new image?
You have two options really.
1) is to use image modification scripts to reproduce a cropped image, like TimThumb (requires PHP). This will crop the image dynamically. It's unclear from your question whether you don't want a new image at all, or whether you just don't want to create one manually.
2) is to do something nifty with HTML/CSS. Basically you'd create a container for your image, hide the overflow, and position/resize the image within it. It'll be something like this...
HTML:
<div class="crop">
<img src="image.jpg" alt="">
</div>
CSS:
.crop {
display: block;
height: 100px;
position: relative;
overflow: hidden;
width: 100px;
}
.crop img {
left: -20px; /* alter this to move left or right */
position: absolute;
top: -20px; /* alter this to move up or down */
}
I have 40*40px png with transparent background with a 30*30px circle in the middle.
I would like to use that png as a button with a simple hover effect, but i want the hover effect to take place only when the cursor is actually on the circle, not on the transparent background.
Is there a plain HTML+CSS solution for this? I tried to check it here and on other forums, but I didn't find anything.
Yes, you can do this with HTML and CSS. First create a circle element and place it before your image. Then wrap both your image and the circle in a container, like this:
<div class="container">
<div class="circle"></div>
<img src="your-image.jpg" />
</div>
Then, use position: absolute to position the circle on top of the image (align it with the circle that's in the image), and use the + selector to select the next adjacent element when the circle is hovered.
.container {
position: relative;
}
.circle {
position: absolute;
top: 100px;
left: 100px;
width: 100px;
height: 100px;
border-radius: 50%;
background: #222;
}
.circle:hover+img {
border: 5px solid aqua;
}
See DEMO.
Check out this script if you need to activate hover/click only when mouse is within the circle (and not in the square bounding box) http://tympanus.net/codrops/2011/11/22/hover-and-click-trigger-circular-elements/
It’s not possible in CSS only, as all elements are treated as rectangles, even if they are rendered with rounded corners.