In the attached example (here) there is the first background image of the woman in the car, I would like to transfer this out and instead put an auto run, on loop video (mp4) full width and same height in the place. All other copy and content is to remain the same - any ideas how I can do this simply?
All other images if you click on the arrows should also remain. Thanks!
For simplicity. You may use a GIF as a background-image:url(GIF_PATH) instead of a video.
Here is a codepen example
https://codepen.io/leemark/pen/dJxHp
or else you have use the HTML element to embed video content in a document.
https://developer.mozilla.org/en/docs/Web/HTML/Element/video
Also you may also like to have a look at owl corousel
Related
When I embed a long gist (in this case of a Jupyter Notebook), the resulting box on my website has vertical scrollbars. I'd like to avoid these scrollbars and just have a longer page (in the same way it's on the actual gist website). Is there any way to do this, with CSS or otherwise?
I'm basically looking for the exact opposite to
Make Gist embed scrollable
Note that specifying a minimum height in CSS does not work: It produces a white box of the correct size, but the content is still scrolling in the top part of that box only
As I can check, the embed code inserts an iframe and there is no simply way to detect the height of that document (cross-domain).
This might help: Resize Cross Domain Iframe Height
But keep in mind that the workarounds are overkill, I think.
For e.g. I have 4 thumbnails and 1 large image. When I click on a thumbnail, the larger image changes to that thumbnail picture.
I thought there might be a value to place inside target=""?
I was hoping to use only html/css as I don't know other languages well but any solution would be great I've tried looking everywhere.
A couple of possible solutions:
Pure HTML: Use an <iframe> with a name to contain the larger image, and embed the thumbnail images in <a>s with the appropriate target and href
Pure CSS: Include all 4 pictures, with display: none set, and display: block within a rule with the :target pseudo class, and each with an id. Embed the thumbnail images in <a>s with href=#id.
Then there are of course the Javascript/jQuery solutions.
This will give you the answer you need. There is some JavaScript but it's very basic.
Simple Image Swap
Notice the blue sidebar has a grain effect added to it.
How to I achieve this without using an image?
You can create a textured image with only a few colours to achieve a grain effect. As a GIF or similar, it will only amount to a few hundred bytes if you do it right. That is, make a small image and tile it.
If you want to find out how a specific site achieved that effect, use a DOM inspector to check the code behind the element. Chrome has this functionality built-in if you right click and choose "Inspect Element". I bet you'll find there's a background image.
In my website I have an image as the navigation bar and have created hotspots to link them to different pages. The problem is since the text is a part of the image, I cannot change the style of the text on hover. Whereas I want the text/the hotspot to stand out on mouseover, so I learn the background color could be changed on mouse over. Is that possible? Is there a way to do that in CSS, using the area or maps. If Javascript is to be used, could someone help me out with it.
Is there a reason you've used a single image as the nav bar?
Instead of a single image with hotspots, I'd use an individual image for each navigation link. That way you can easily change the image (or use CSS image positioning) on hover. This is described here:
http://css-tricks.com/video-screencasts/7-three-state-menu/
along with many other places I'm sure.
I don't think it's a good idea to use neither image maps nor individual images.
Instead, use CSS sprites: a single image file, add that as a background image to the menu links, but position the background images differently. See this Line 25 tutorial for more information.
I have a site that uses a large centered background image, which naturally loads a tad slower than the other elements on the page. For the most part this works okay, but there is also a repeat-x background image that covers the background for large monitors. The only problem is that this smaller file loads first and flashes briefly before the large image loads fully. Is there a way to have the large image load first so it is in place before the repeating background image loads? Thanks!
I don't know whether there is a way to accomplish that but you can use either javascript or jquery to change your dom elements show priority.
There's no way using strictly css to absolutely control the order images load.
The browser will try to download the images in the order they're listed in the css file, so putting your large background iage first will help, but the download time is gonna make it a moot point more than likely.
You could load the larger background via javascript once the rest of the DOM has loaded if it's worth going that far.
I figured out the answer to my own question: Instead of repeating the whole pattern of the upper body, I used only the pattern portion that is where the main content is. This loads quickly and looks natural behind the content while the large image loads. Thanks Aaron for the reply.