Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
I hav a div tag.In it's css properties i've put the image and the tried to resize it using height and width properties.But instead of shrinking it is getting cropped! How am i supposed to scale it using height and width?
Hope this helps:
div{
height: 100px;
width: 100px;
background-image:url(img.jpg)
background-size: 100%;
}
If image is used as a background. Not sure exactly how your code is set up.
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 days ago.
Improve this question
I want to make an DIV with an Scroll option. So I put an height in the CSS from the DIV and put the overflow-y on auto, so it creates an scrollbar, if needed. But for some reason the height is at 0px and the overflow is visible. How it looks like How the css of the DIV looks like
I tried to change the height, and also to remove the height, but nothing worked
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 11 months ago.
Improve this question
I've been working upon a Personal Portfolio for a few days now. I originally made it for my freeCodeCamp certification. But, now I wish to expand it however I've been facing a strange issue with the page where part of the body goes off-screen. I've tried resizing and removing the height of various elements and changed their display and position properties. But it's not working. I mean, it's not the biggest problem since all text and images are visible but still it's annoying.
I've hosted it through Github Pages here is the link:
brainstormed.github.io
It would be of great help if someone could point out what I'm doing wrong.
Thanks!!
The fixed padding of 40px on projectTile CSS class is causing the issue. On small screens the horizontal space is already filled by the image width: 80vw; padding: 10px; margin: 20px. You can either remove that padding or use a media query to remove it on small screen sizes.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
This is driving me crazy!
It's not the padding or margin.
I tried to use overflow: hidden and setting a height, but overflow: hidden dose nothing and setting a height breaks my layout.
any help would be great thank you.
here is the site
https://www.myccandbuilds.com/
And the space between the header and the Black background div is what I'm talking about.
This is caused by display property on the header, try display: flex; instead of display: block;.
it should fix this problem.
It seems to be being caused by line height. The issue also goes away with "line-height: 0;", meaning that there's possibly some empty text (newline, whitespace) in your element that's taking up space after the image.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
There is empty space at the bottom of my site, showing just the background image. If I set the height of .content to auto or 100%, that makes things even worse and destroys the site. How can I get rid of this empty space while still preserving the white box holding all my content?
http://www.michaelaoun.com/noursite.html
Link to the html file: https://www.mediafire.com/?l435v31v56du9ms
Add an overflow:auto CSS style to your #mainContent div so it expands to the floating content inside of it.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
I'm having a query with my site currently which I require some assistance with.
When a user will load up my site, the image of the 'cutlery pouch' will be resized according to how big the user's browser/monitor is. However when this happens the image some users see will be the background of the image, instead of the main feature, the pouch.
I was wondering if there was a way around this so the image resizes when using 100% width and a fixed height.
Here is a quick link to my problem so you guys may be able to help me.
A link to my website
Thank you in advance for any helpful responses.
Instead of
background-position: 0 22%;
try
background-position: center 22%;
And perhaps edit the image to have the pouch more centered.
You could probably just adjust your image so that the pouch is centered in the image itself, then use background-position: center;
Edit: I notice your image is a square, where as the container you're putting it in is a rectangle. This is also not helping towards it being positioned correctly. Try adjusting your image to the aspect ratio of the container as well.