Posts Tagged ‘tutorial’
Multiple Class / ID and Class Selectors
|
Can you spot the difference between these two selectors?
They look nearly identical, but the top one has no space between “#header” and “.callout” while the bottom one does. This small difference makes a huge difference in what it does. To some of you, that top selector may seem like a mistake, but it’s actually a quite useful selector. Let’s see the difference, what that top selector means, and exploring more of that style selector.
Here is the “plain English” of “#header .callout”:
Here is the “plain English” of “#header.callout”:
Maybe this graphic will make that more clear:
Combinations of Classes and IDsThe big point here is that you can target elements that have combinations of classes and IDs by stringing those selectors together without spaces. ID and Class SelectorAs we covered above, you can target elements by a combination of ID and class.
Double Class SelectorTarget an element that has all of multiple classes. Shown below with two classes, but not limited to two.
MultiplesWe aren’t limited to only two here, we can combine as many classes and IDs into a single selector as we want.
Although bear in mind that’s getting a little ridiculous =) ExampleSo how useful is all this really? Especially with ID’s, they are supposed to be unique anyway, so why would you need to combine it with a class? I admit the use cases for the ID versions are slimmer, but there are certainly uses. One of those is overriding styles easily.
The second targets the same element, but overrides the color, instead of having to use:
or perhaps prefacing the selector with something even more specific. More useful is multiple classes and using them in the “object oriented” css style that is all the rage lately. Let’s say you had a bunch of divs on a page, and you used multiple various descriptive class names on them:
They all share the class “box”, which perhaps sets a width or a background texture, something that all of them have in common. Then some of them have color names as classes, this would be for controlling the colors used inside the box. Perhaps green means the box has a greenish background and light green text. A few of them have a class name of “border”, presumably these would have a border on them while the rest would not. So let’s set something up:
Cool, we have a good toolbox going here, where we can create new boxes and we have a variety of options, we can pick a color and if it has a border or not just by applying some fairly semantic classes. Having this class name toolbox also allows us to target unique combinations of these classes. For example, maybe that black border isn’t working on the red boxes, let’s fix that:
![]() Border color on red box changed because it had both the red class and border class Based on this demo page. SpecificityAlso important to note here is that the specificity values of selectors like this will carry the same weight as if they were separate. This is what gives these the overriding power like the example above. Browser CompatibilityAll good current browsers support this as well as IE back to version 7. IE 6 is rather weird. It selects based on the first selector in the list. So “.red.border” will select based on just “.red”, which kinda ruins things. But if you are supporting IE 6, you are used to this kind of tomfoolery anyway and can just fix it with conditional styles. |





How to Create a Dark Emotional Photo Manipulation
This is a tutorial with a simple idea: to create an emotional photo manipulation. Following this tutorial, you will learn how to blend different images to make a dark atmospheric background, modify the dress of the model, apply makeup, paint hair, blend different objects in the background, and more – all to create a moody illustration. So, let’s start!
Final Image Preview
Take a look at the image we’ll be creating. Want access to the full PSD files and downloadable copies of every tutorial, including this one? Join Psd Plus for just $9/month. You can view the final image preview below.
Video Tutorial
Our video editor Gavin Steele has created this video tutorial to compliment this text + image tutorial.
Arranging the Stock Images
The photo manipulation in the tutorial was created using the following stock images:
Step 1
The first step is to create a new PSD. Go to File > New. I choose to work in CMYK color mode.
Step 2
The next step is to create a background. Drag the Autumn Leaves background picture into the new file. Duplicate the layer and arrange it like in the first picture. Add a layer mask and erase the edges like in the picture below so it will look natural. Duplicate the layer again, add a new layer mask, and erase the edges as shown.
Step 3
Add a Color Balance Adjustment Layer and arrange the levels to: -57, -56, +26, as shown.
Step 4
Now add an Adjustment Layer of Curves and choose 38 for the output and 27 for the input.
Step 5
Drag the Fantasy Forest picture into the file. Now add a layer mask and erase on the edges using a basic, black brush as shown.
Step 6
Go to the Autumn Leaves picture layer. Choose the Lasso Tool and insert a part of the leaves. Press Command + J . Arrange the new layer as shown.
Step 7
The next step is to cut-out the Melancholia Model. Open the picture with the model. Select the Pen Tool and cut out the model. When you closed the path right-click and Make Selection (Radius of 0 ) and then press Command + J.
Step 8
Drag the model into the main document and arrange it as shown.
Step 9
The next step is to remodel her dress, since it appears to be too short for this background. Grab the Pen Tool and cut-out a copy of the end of the dress.
Step 10
Arrange the copy as shown.
Step 11
Create a new Adjustment Layer of Curves and choose 32 output and 20 input.
Step 12
Fill the layer mask with a black color (Alt + backspace). Choose a basic brush, then with white color the shadow of the model as shown.
Step 13
Open the creepers from the Vines file. Drag them into the PSD file, and arrange them as shown.
Step 14
Now let’s paint the hair. Create a new layer and pick the color you want to be the darkest and paint the shape of the hair. Next, create a new layer and with a lighter color paint some hair. Do this operation a few times on different layers and with lighter and lighter colors until you have the right result.
Don’t do them on the same layer because if you don’t like the result you have to erase all the hair. Once you have the right result, merge all the hair layers (press the Command button, select the layers, and then press Command + E). Next select the Burn Tool and put some shadows on the hair and select the Dodge Tool for the lights. Follow the images below for guidance.
Step 15
Go to the model’s layer and select the Burn Tool. Apply some shadows on the model’s dress.
Step 16
Go to the Adjustment Layers, create a Color Balance layer, and use these settings: 0, -19, -27. Fill the layers mask with black and with white color paint the creepers.
Step 17
Next let’s paint the model’s face. Create a new layer. Select a light color of the model’s face with the Eyedropper Tool and with a basic brush (4 or 5 for Opacity) paint her face. Create a new layer and paint her eyes. Do the same for the mouth. Don’t paint them on the same layer.
Once you have a satisfying result, merge the layers (press Command, select the layers you want to merge and then press Command + E). Use the Burn Tool for the shadows of the face and the Dodge Tool for the light.
Step 18
Drag and drop the Ravens as shown.
Step 19
Create a new layer to paint the ravens’ wings and jewels, as shown below. Do the same with all the crows. For this, use a basic round brush with smooth edges.
Step 20
In this step, create a new layer and draw some shadows with a basic brush on the model’s hand. This is a minor detail, but it’s important because it makes it look natural.
Click here to see full Tutorial…