Wszystkie wpisy, których autorem jest admin

CSS Basics: Using Multiple Backgrounds

Post pobrano z: CSS Basics: Using Multiple Backgrounds

With CSS, you can control the background of elements. You can set a background-color to fill it with a solid color, a background-image to fill it with (you guessed it) an image, or even both:

body {
  background-color: red;
  background-image: url(pattern.png);
}

Here’s an example where I’m using an SVG image file as the background, embedded right in the CSS as a data URL.

See the Pen background color and image together by Chris Coyier (@chriscoyier) on CodePen.

That’s just a single image there, repeated, but we can actually set multiple background images if we want. We do that by separating the values with commas.

body {
  background-image: 
    url(image-one.jpg),
    url(image-two.jpg);
}

If we leave it like that, image-one.jpg will repeat and entirely cover image-two.jpg. But we can control them individually as well, with other background properties.

body {
  background-image: 
    url(image-one.jpg),
    url(image-two.jpg);
  background-position:
    top right, /* this positions the first image */
    bottom left; /* this positions the second image */
  background-repeat:
    no-repeat; /* this applies to both images */
}

See how background-position also has comma-separated values? Those will apply individually to each image respectively. And then how background-repeat has only one value? We could have done two values in the same way, but by using just one value, it applies to both.

Here’s an example using four separate images, one in each corner, offset by a smidge:

See the Pen Example of multiple backgrounds by Chris Coyier (@chriscoyier) on CodePen.

It’s too bad you can’t rotate or flip background images or else we could have used just one. We can rotate and flip entire elements (or psuedo elements) though, so in cases like that, we can get away with using a single image!

See the Pen Flipping Image So You Can Use Just One by Chris Coyier (@chriscoyier) on CodePen.

Just a few other things to be aware of here:

  1. The stacking order of multiple background is „first is on top.”
  2. Gradients are applied through background-image, so they can be used as part of all this. For example, you could set a transparent gradient over a raster image.

See the Pen Tinted Image w/ Multiple Backgrounds by Chris Coyier (@chriscoyier) on CodePen.


CSS Basics: Using Multiple Backgrounds is a post from CSS-Tricks

5 Tips to Being Creative with a White Wall

Post pobrano z: 5 Tips to Being Creative with a White Wall

A white wall is not as dull as we are made to believe. It’s just plain and simple. And since it’s a color like any other, it can be customized to reflect your sense of style. As a matter of fact, white walls are very iconic because they stand out when mixed with other colors. Most people assume that white walls are only found in rental houses. There are actually homeowners that insist on painting some of their walls white. The advantage of such a color is that it can’t be neglected because it’s easy to spot patches of dust and dirt. Here are tips that can help you utilize a white wall.

1. Transform it into Dry Erase Board

If there are white walls in your house, you can convert a few of them into whiteboards. Such boards come in handy when kids are studying on their own. All you have to do is buy dry erase wall coating and apply it on top of the white wall. Since most kids prefer to study in isolation, you should consider creating the whiteboard in either of their bedrooms. This type of whiteboard is durable than the portable type because there are zero chances of breaking due to accidental falls. However, you have to give the coat at least 48 hours before it can be ready for use. These whiteboards have of late become popular because they don’t limit your space. They are also easy to maintain.

2. Bring in Colored Furniture

The worst mistake that you can make when you have white walls is to add furniture of the same color. Although the furniture will definitely blend with the white walls, the interior of the house will have a dull outlook. This is because the walls will capture all the focus. It’s therefore advisable you bring in furniture of a different color. This will help in creating a balance. You can even add throw pillows that have bright colors.

3. Add Wall Hangings

A plain white wall can seem idle when it’s not complemented by artwork. It’s therefore recommended you include wall hangings such as paintings, pictures, and mirrors. However, you should make sure that the wall hangings have frames that are either brown or black in color. Mirrors work well in the bathrooms while wall hangings are a preserve of living rooms. You should also consider spreading some rags on the floor just to divert attention away from the walls.

4. Blend with White Kitchen Furniture

If the walls of your kitchen have been painted white, you should consider blending them with white tiles, cabinets, and shelves. When a white finish is complemented with fittings of the same color, it creates a luxurious impression. You can also opt to add exposed patches of the brick wall to give your interior a countryside look.

5. Bring Natural Plants

Live plants do a great job in adding life to white walls. However, you have to put your plants close to the window so that they don’t die due to lack of sunlight. Besides that, you should not put more than two plants because too many of them will congest the living room.

Featured image by NeONBRAND