Hot answers tagged

63

There are a lot of ways to animate things on the web. There are even more ways to create animations then export to web animations. There are huge benefits to designing animations in something like AfterEffects or Animate CC (which can both import Illustrator and Photoshop files) for the obvious reasons of division of labor and use of a graphical editor. With ...


35

I, like you and many other people starting to learn CSS, used to think the same thing. However, as I continued to build websites I realized that using percents only leads to uglier websites. There are a few reasons that contribute to this: Raster type, images, etc. don't scale perfectly. The browser has to approximate the rendering of these elements when ...


24

From a purely design standpoint, starting with the mobile version first does make sense. The hardest part of the design process is always pruning, never adding. So the smaller the screen real estate you allow yourself, the more you'll have to think about what is important in your design, what information you really need to show. Also, you'll force yourself ...


21

As an alternative to the already great answers, how about adding a black div with 50% opacity behind the text? This would allow the font to work on basically any image also. div { position:absolute; top:250px; left:140px; width:500px; height:50px; background-color:black; z-index:0; opacity:0.5; } EXAMPLE


17

I suggest making the font bold (just a change of weight, not the font itself) and respecifying the shadow so that it defines all the edges of the letters: font-family: Raleway; font-weight:900; text-shadow: 0px 0px 3px #000; You can even combine more than one text-shadow to create a definite outline as well as a blur: text-shadow: 0px 0px 3px #000, -1px -...


17

Percentages are sometimes too flexible. If you define everything in percentages then the site will scale uniformly. But its very unlikely for a user of a 27-42 inch monitor wants you to scale text by their screen width. Same way a small screen user may want the font to stay relatively fixed when they turn the phone. So you want to have some items at fixed ...


16

It is called subpixel rendering, or subpixel anti aliasing. Microsoft does something similar for most windows applications. Your screen consists of colors that are next to each other. If you do a simple sample based anti aliasing you do not get the best possible result. But by leveraging of the knowledge of how the pixels are laid out you can get better ...


15

I think the accepted is wrong. The css px is actually Device Independent Pixel(dip), and it is a common pattern to use px as dp in css.


13

I would not continue trying to learn how to slice up a PSD for HTML. This practice is outdated and you're only going to be hurting yourself down the road. In regards to "current standards" people usually code in an IDE. One thing you have to understand with slicing is if you have a responsive website you're going to spend a ton of time trying to cut a ...


12

You could use CSS (keeping in mind this won't work with older versions of IE). For example, you could combine some shapes like a rectangle and two triangles. See this jsfiddle. HTML: <div id="square"></div> <div class="align"> <div id="triangle-topleft"></div> <div id="triangle-topright"></div> </div>...


12

There are a few issues here. Not everyone uses a grid system and even if they do there's no guarantee the grids are consistent. Maybe your example uses a four column grid with a wider left column. Grids are a tool. A guideline. They don't necessarily mean you are bound to your grid 100% of the time. Often, if people are designing using a pre-baked framework ...


11

When drawing a citcle in Inkscape then this will be its path : To convert this path to Bezier lines just select the object, then choose Path > Object to Path: We can now insert nodes, break paths or whatever there is we need to do (below example was obtained by inserting 3 nodes and deleting the path between two selected nodes):


11

Skeuomorphism is really the opposite of flat design. Google's "Material Design" is merely their branding name for their specific interpretations of flat design. It's still flat design though. "FLat Design" was coined by Apple when they released iOS7. It caught on because it was the first term used, it could just have easily been called "Material Design" if ...


11

This might not be quite the answer you're looking for, but I find it better than handing mediocre, auto-generated styles to the engineers. Selective markup I'm sure you've discovered Sketch's context menu CSS grabber. You can select as many objects as you like and you'll get the CSS on your clipboard faster than you can paste it. There's no selectors of ...


11

Mobile first is best practice -- it's not law, and if you understand why you "should" be using it, you can make an informed decision as to why you don't want to use it on a particular project, and that's fine. It's worth noting that "mobile first" relates to the design/UX and the build itself. Mobile first design won't speed up your site for users, but ...


11

I needed to convert <linearGradient> from many SVG files to CSS, and I made this: https://codepen.io/JosephusPaye/pen/vbaxBa?editors=0010. Paste an SVG source and it'll extract all the <linearGradient>s and convert them to CSS. How it works, in summary: Parse the input as an SVG document Find all <linearGradient>s Calculate the slope ...


10

Looks like the link Ian Dunn posted might be your ticket. Here's an excerpt from that page: In the SVG export options, I select Style Elements, and I select the Include Unused Graphic Styles option. It will declare sandStyle and blueSky as CSS styles in the SVG document. Here is the SVG output generated by Illustrator CC: <style type="text/css&...


10

Demo css .demo-container { height:300px; overflow:hidden; display:block; position:relative; /* CSS3 Gradient */ background: rgb(125,126,125); background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/...


10

I didn't love the answers and comments already provided; too much code for a simple sphere in html - css. You can simply do: <div class = "sphere">Test</div> The CSS: body { background: #333; } .sphere { width: 200px; height: 200px; line-height: 200px; text-align: center; color: #FFF; margin: 100px auto; /* ...


10

Is is possible? Yes. Technology-wise, you would do the same thing you'd do for language localisation (see this related SE question for the specificities). Localization refers to the adaptation of a product, application or document content to meet the language, cultural and other requirements of a specific target market (a locale). Source Seems like ...


8

I believe the full answer to your question can be found here: https://stackoverflow.com/questions/2025282/difference-between-px-dp-dip-and-sp-in-android To convert dp to px you need to take account of the display dimensions you are addressing to. The greater the DPI, the more pixels you'll have to cram in the same area to make it look good and to avoid ...


8

Open image in Photoshop Go to Filters > Other > Offset Adjust vertical offset so that the image seam is in the middle of the image Use the liquify tool to seamlessly connect the ribbons together Fail miserably Consider trimming all excess whitespace, and use background-size: contain instead More info on the background-size property


8

If I were you I'd abandon the Idea. Hires handling is the least of your problems, because there is simply no support within E-Mails. But the problems start earlier. Most email clients strip out images and add a button where the user can activate the images. All this fuss for just a logo is just too much of a hassle. I would just write the sig with ...


8

You have two main options as workflow (although as DA01 pointed out, these are just a few of many possible ones): Create the mockups in Photoshop or similar software, and then manually re-create them in HTML/CSS; Create the design directly in HTML/CSS. In option 1, you would basically use the photoshop file as a reference, mostly to calculate distances and ...


8

Consider using established UI patterns like the burger menu icon or an arrow to show that there is a draw or menu. The icon is enough for people to know there is navigation / settings to be clicked. This is just a quick sketch, but you can get icons like this from Bootstraps library.


8

The rendering of UTF emojis is platform / vendor specific. There is no CSS or other tricks involved. Different vendors (Apple, Google, Microsoft, Mozilla, Samsung etc.) simply chose to provide different icons for these UTF characters. In Chrome on a Mac, for example, the two alien characters you linked to do not appear in green. This is what they look like: ...


7

Sure, you can use the ExtendScript Toolkit to investigate and manipulate Photoshop documents. For more info, check the documentation or search around the various PS scripting forums. Based on the script in this article, I whipped up the following script. For every text layer in a PSD file, it will print the font, font-size, and fill-color to the javascript ...


7

Yisela's answer is solid, but I figured I'd offer up this alternative: using polygon or an image URI with CSS shapes and clip-path. Here's a quick tutorial. Note that this method will work with even fewer browsers than the triangle border trick at the moment. However, if you want to use a more complex shape or wrap your text to the shape this will be the ...


7

Considering you are targeting only the latest browsers (at the moment of writing Chrome 37.x, Firefox 32.x, Internet Explorer 11 should cover main latest rendering engines), you can accomplish cross-browser compatibility fairly easily and for most cases - hack free, since all of the mentioned browsers support most of the newest HTML and CSS properties. A ...


7

The primary balance you have to be especially careful of when using a technique like scroll points is a balance of control. You don't want to unnecessarily take away or curb a user's control if you can help it because they are used to navigating in a particular way. (The slides linked throughout this post are from my talk on meaningful animations) When I ...


Only top voted, non community-wiki answers of a minimum length are eligible