logo
down
shadow

Background-image width & height 100%


Background-image width & height 100%

By : 黃德洋
Date : November 22 2020, 10:31 AM
Does that help I have a div on my site and in this div i want embedd a background-image. The problem is now, i cant see the picture. How can i see the picture? I cant finde my mistake. If i embedd the picture in the HTML Code it works, but not in the css Code. Because i want to create something like that: Page(The image + scroll) , you need to add:
code :
html, body{
  height: 100%
}
.pic1{
  background: url("images/line-header.png") repeat-x scroll center bottom #4A525A;
  background-size: 100% 100%;
  height: 100%;
}


Share : facebook icon twitter icon
How to limit the background-image width/height of my custom bullet list background?

How to limit the background-image width/height of my custom bullet list background?


By : Святослав Шапкин
Date : March 29 2020, 07:55 AM
help you fix your problem I think it would be better to do something like this. Adjust values to your needs.
code :
<li><span></span></li>
li { position: relative; }
li span { 
    position: absolute; 
    left: 0;
    width: 16px;
    height: 16px;
    margin-right: 16px;
    background: url('img.jpg') 0 0 no-repeat;
}
li:hover span { background-position: 0 -16px; }
Is there a way to make background image auto width, full height, height scroll, no width scroll

Is there a way to make background image auto width, full height, height scroll, no width scroll


By : Honeybronzed
Date : March 29 2020, 07:55 AM
hop of those help? I want to place a picture to background thus it was full screen, the width of image should change to body width and no horizontal scroll. On the other hand, I want height be with ratio to width (no distortion) and had vertical scroll. I am now doing: , Why not setting image background in body?
code :
body {
    background: url(back.jpg) no-repeat fixed center center;
    background-size: 100%;
}
Responsive width Div with image background as a full width header image (fixed height)

Responsive width Div with image background as a full width header image (fixed height)


By : user
Date : March 29 2020, 07:55 AM
wish help you to fix your issue Possibly aim for the bit you want to focus with percentages.
HTML:
code :
<header></header>
header {
    background: url('your image') 20% 20% no-repeat;
    height: 100px; /* ? */
}
How to make background-image size height always equal what the image height needs to be for full width image?

How to make background-image size height always equal what the image height needs to be for full width image?


By : rohan
Date : March 29 2020, 07:55 AM
Any of those help Do you mean background-size: cover;? What it does (source):
How to set fixed height for background image in HTML using css and the width should follow the device width

How to set fixed height for background image in HTML using css and the width should follow the device width


By : Harisha
Date : March 29 2020, 07:55 AM
Hope that helps I am in a situation where I need my bg image to be of the fixed height and the width of the image should vary on device width change. The image should crop according to the device width and whenever the device width increases the width of the image should also increase. Let's take a scenario where I have an image of width 2000px and the first device it is being viewed is of 1200px then the image should be cropped from both the side i.e. from left 2000-400=1600px and from right 1600-400=1200 and this is how the image should fix in the background. Now if the device width increases the height should always be fixed for example the height of the image is 200px and width is 2000px and it is being viewed on the device having 1000px of with then the image should be of the fixed height and the width should vary as stated above. , Try with following CSS
code :
background-image: url('bg.png');
background-repeat: no-repeat;
background-attachment: fixed;
background-position: top center; 
Related Posts Related Posts :
  • Bootstrap3 - Removed container-fluid
  • Bootstrap framework not responsive for asp.net webform
  • How to align two inner divs inside outer absolute positioned div that has fixed width in which both divs have the same w
  • Div to ignore html tags
  • Prevent caching and stale content with a static web site
  • Is there a way to change the whole document with one selector in CSS?
  • why cant I click om my navigationbar links?
  • Is there a CSS/HTML way to cut multiple shapes out of the top/bottom of a div?
  • css border around multiple links/images
  • 'No data was received in the uploaded file', but file is not empty
  • How input boxes save previous entries
  • AMP carousel direction change
  • Bootstrap multiple carousel not working on thumbnails click
  • Is there a way to put a permanent space into an input field?
  • Html boxes not displaying properly
  • How can I change a variable in Jekyll _config.yml dynamically?
  • How can I prevent DIVs from overlapping a right floated image?
  • Eclipse and .tml files highlighting not working
  • Footer is not in the bottom of the window, (phonegap jquery mobile app for windows mobile)
  • How to put div over another
  • How to use glyphicons in bootstrap 3.0
  • Wordpress page links not working
  • How Do I Use CSS to Set the Color of An ALink?
  • Webpage doesn't scroll smoothly on screen
  • YouTube iframe, browser looks for file locally
  • html displaying inline image
  • Font acting differently on IE and Firefox
  • Encoding and decoding of the character references
  • An Image Button navigate to another site html/css
  • IE8 "Save Target as ..." won't display for block elements
  • Image hover transition for span - CSS
  • How to apply min and max on textarea?
  • How to draw multiple horizontal lines (Notebook Paper effect) using css?
  • Table Printing Issue: Gaps in top and Bottom Border of th Elements
  • grouping elements with div and applying stylesheet for that group
  • Click <div> to expand, then click again to shrink - Its expanding, just not shrinking
  • CSS - How can I center a <script>'s output?
  • Django's template variable gets interpreted as HTML
  • ngx datatable vertical scroll with rowheight set to auto
  • How to make input text border with CSS when it's OnFocus
  • Anyone know of a calendar web widget for my website I could use?
  • How does Bootstrap manage to use fixed positioning for navbar on iOS?
  • Centered text in fully clickable table cell
  • Compare HTML and HTML5
  • steps of creating webpage in bangla
  • css root element margin
  • What is the point of using absolute positioning in CSS?
  • Responsive solution for long URLs (that exceed the device width)
  • Divs don't collapse as they should - media queries
  • QTreeWidgetItem display html
  • Testing html/css image on local from jfiddle
  • long attribute value of HTML
  • Why my svg picture is truncated at the bottom when embedded in html
  • Display CSS: some divs fixed, some flexible (2)
  • How to append href strings with variables in html with PHP?
  • css - Why is there a big white space between text lines?
  • div image position fixed + scroll
  • Hide specific elements from html using css
  • how to align the arrow in menu item?
  • How do I create a trapezoidal button using CSS?
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org