I hope you guys can give me a hand on this one because I’m at my rope’s end with this piece of inline CSS nightmare. So. I want to have two columns of product categories, changing the size of the actual columns wasn’t hard but I have the problem with the blurry images. They are way bigger than the div but they still look blurry.
Inspecting the .prod-img-wrap div reveals it contains a tag with no class or ID that has some in-line CSS that I assume it’s probably generated elsewhere.
All the sollutions online show a older version of WooCommerce that still had actual inputs for the image sizes separately, now in the Customize > Woocommerce > Product images panel there’s only the crop options available. If I change the hard coded values in the inspector, the image loads fine, so I know it’s uploaded correctly.
I don’t even know what else to try at this point, I’ve been going at it for too long and it’s literally one of the last few details that I need to get sorted to deliver this website soon. I’m also quite unexperienced in WordPress so this might be a easy or obvious one for the more seasoned coders amongst you. Any help would be greatly appreciated, thank you so much for your time.
The page I need help with: http://sellgoldnow.co.uk/
EDIT:
I am trying to override with css the inline style generated here:
<div class="prod-img-wrap"><img src="http://sellgoldnow.co.uk/wp-content /uploads/2018/09/gold-bracelets1-262x108.jpg" alt="Bracelets" sizes="(max-width: 262px) 100vw, 262px" width="262" height=""></div>
With the following css:
.prod-img-wrap img[style]{
max-width: 705px !important;
width: 705px !important;
height: auto !important;
}
This is the part that I don't know how to "target" as I'm unfamiliar with the formulation, it's the first time i've seen it.
sizes="(max-width: 262px) 100vw, 262px" width="262" height=""
firstly, the images are blurry because their actual size is much much smaller than the area they are being made to fill. [they are only 262px x 108px and they are being stretched to 703 x 277px] So i would say you need to be adding larger images.
Secondly, if you are adding much larger images and the woocommerce is cropping it, try the plugin "Regenerate Thumbnails" [has million+ downloads]and go through those steps.
Lastly once you have added larger images and its still not working correct, try changing the thumbnail cropping settings in customiser. I would suggest 1-1 or uncropped.
Let me know if this helps!
EDIT:
to target those images you can use this class + code to override it:
ul.products li.product.product-category img,
ul.products li.product img {
max-width: none!important;
width: auto!important;
}
this will ensure those images display at their actual size.
Related
I am setting up a blog with a new flat theme. I haven't used these before so please excuse me if I don't explain myself well.
This theme, Cordillera, comes with a full screen banner which has text layered over it. The look is great but I'd really like to be able to either a) be able to set the banner size myself or b) have it automatically adjust the container height to the image uploaded. Both being smaller than full screen, which would pull up the content below it.
Not having used this type of theme before I'm not sure what to look at to adjust this. You can check out the demo linked above or on my blog. I'm not even sure what portion of code to pull out to have you start with. If you go to my blog, the section in question is the one with the angel art.
Thanks so much for looking! I appreciate any and all help!
try to add this CSS into your site :
.top-banner {
width: 100%!important;
height: 300px!important;
background-size: contain!important;
}
go to "Appearance > Customize > additionnal CSS"
I am a photographer and currently attempting to upgrade my site from a Portfolio of my images to a fully functional E-Commerce site.
I have gotten my head around most of the WooCommerce type things I need to do, and I have an idea of what I want. I feel like I can achieve pretty much what I want.
The big problem I'm having is dynamically picture framing my images for sale.
Some examples of what I want:
https://mattlauder.com.au/main-photo-gallery/landscape-gallery/lavender-bay-black-white/#prettyPhoto
https://kenduncan.com/product/docklands-melbourne-vic-vx2101/
Just the ability for me to make a .PNG frame, and have it dynamically added to the background of my images as the variations are selected.
I'm reasonably sure it's a simple coding thing, but I have 0 experience coding.
Any help would be awesome! I couldn't see a simple plugin to do what I want, and I couldn't really see any existing plugin or theme that would add this functionality.
Dan
You don't need to edit the images directly, and I don't recommend it because it requires a lot more work. CSS does the trick!
Since you said you are using woocommerce, I have targeted below the default woocommerce image in the gallery on the single product page.
This is a very basic picture frame - and you can make it a lot cooler if you want it to be (such as a matte)!
.woocommerce-product-gallery__image img {
border: 15px solid #666;
padding: 10px;
}
Add this code to your theme's custom CSS field.
For something like this https://mattlauder.com.au/main-photo-gallery/landscape-gallery/lavender-bay-black-white/#prettyPhoto
You will need some javascript.
Upload the frame png and all frame variations to your WordPress site.
Give your image class padding of variable size.
In the JavaScript code, replace the background image of your image element. Make sure your background is set to no-repeat.
Some CSS tweaking might be needed to get it to look exactly how you want.
I have designed a website on my retina monitor, set at the highest resolution. On this resolution the site looks really great :p. However, when I view the site on a smaller 13" monitor, all the elements and the font are way too big and in your face.
I have done some research, and found two ways to try and show the website in a nice way across different desktop screen sizes:
Use a media query to Scale/Transform the body. However, this "feels" wrong and I can imagine this has some performance impact. Furthermore I can imagine this gives inconsistencies across screen sizes
Use ems across the board. I am not really sure what'd be the right starting point for this, but I have read that some people base everything upon their font-size. However, I would not really know how this'd work for images.
Can someone please tell me what'd the best way to make the website display nicely across desktop screen size.
p.s. The website is based on twitter bootstrap
I would suggest the second option. The way it would work is by setting the element font size in px, and using relative sizes for the containers and divs inside them.
For example
<body>
<div id="container">
<article>This is some text</article>
</div>
</body>
CSS:
html{
font-size: 32px;
}
#container{
font-size: 1.5 rem;
}
article{
font-size: 1.2 em;
}
CSS-tricks has a nice article on this - http://css-tricks.com/rems-ems/
As for image resizing, that can be done dynamically in JS based on window.width()
I've just started using CSS spritesheets to significantly reduce the number of requests a user makes on our webserver (previously I had designed a page with 200 thumbnails, each linked separately, so that was 200 requests just for those and didn't know it was an issue until someone told me about it)
After going through w3schools I have figured out how to use it and have downloaded spritesheetpacker to help me make the spritesheet as well as give me the dimensions and offsets.
Now I have a CSS file that's extremely long, and am not looking forward to tagging 200 HTML elements manually. Is there a different way to deal with this situation? Here are some details:
I am familiar with javascript (not much JQuery though)
I have all of the dimensions and offsets for the images from the packer.
The page contains a table with a column for thumbnails, and another column with a link to the file associated with it, so people can quickly scroll through the page and pick what they want. You can also click on the thumbnail to see a full-size picture
I am currently displaying the image using the img tag and wrapping them with anchors, where the img class is just the picture filename (since it is also included with the output from the packer)
You can save a bit of CSS by grouping things together with similar dimensions and then just coding the background images.
<a class="buttonA Image5"></a>
.buttonA {
width:100px;
height:30px;
display:block;
}
.image5 {
background-image:url(...);
background-position:....
}
If you use display:block on your anchors, you can use a CSS background on it and eliminate the image tag completely.
I'm pretty new to CSS, I've pilfered a bit of code and made it work for me in the way I want, I've developed a bit of an understanding after trying so many different ways to do what I want but am a bit lost.
I want to do exactly as the title says, image-map whilst allowing for the automatic resizing I'm trying to implement. Obviously I'm trying to make my site look decent on most resolutions without compromising the design I want. The site with my code so far is below:
http://blunderphonics.0sites.net
I would have done it with the old html way of doing it but I don't want any border, which that doesn't seem to allow (as you can't image map with backgrounds).
Please help, it's driving me mad
Not sure you could do this with an image map, since you have to pass pixel-perfect coordinates to the area tags.
However, what I would suggest is several an a tag for each of those areas. Set each link to display: block and size and position them with percentages (like you do in the "bg" class).
For example, the link for that top title that spans the entire page might be styled something like this:
#home-link {
display:block;
width:90%;
height:10%;
position:absolute;
top:2%;
left:5%;
}
This is merely an example, and those numbers are by no means accurate. I'm just using them for demonstration purposes. What you would want to do is do some measurements on that image and figure out the dimensions and positions of those links as a percentage of the entire document. For example, if a link is 100 pixels from the top, and the image is 1000 pixels tall, then you would set the top property of that link to 10%.
Hope this helps.