반응형
반응형

Emergent Web Technologies Spring 2013

Tuesdays, 6:30 PM - 9:20 PM

 

http://iam.colum.edu/Jon.Petto/classes/ewt/

 

 

 

Week 1

Getting Started - HTML5, CSS, & JavaScript

View lesson »

 

Week 2

Git & GitHub

View lesson »

 

 

Week 3

Responsive Design, Part 1

View lesson ›

 

Week 4

Responsive Design, Part 2

View lesson ›

 

Week 5

Media Query Review & Sass

View lesson ›

 

Week 6

More Transitions, CSS Effects & Columns

View lesson ›

 

 

Week 7

Floats, Box Sizing, & Midterm Workshop

View lesson ›

 

Week 8

Midterm Workshop/Presentations

 

 

Week 9

GitHub Forking & AJAX

View lesson ›

 

Week 10

AJAX w/JSON & JavaScript Templates

View lesson ›

 

 

Week 11

CSS 3D Transforms & Animations

View lesson ›

 

Week 12

Google Maps & Geolocation

View lesson ›

 

 

Week 13

Web Sockets

View lesson ›

 

 

반응형
반응형

CSS text-indent Property


첫 문장 들여쓰기

Example

Indent the first line of paragraphs with 50 pixels:

p
{
text-indent:50px;
}

Try it yourself »

Definition and Usage

The text-indent property specifies the indentation of the first line in a text-block.

Note: Negative values are allowed. The first line will be indented to the left if the value is negative.

Default value: 0
Inherited: yes
Version: CSS1
JavaScript syntax: object.style.textIndent="50px"


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

The text-indent property is supported in all major browsers.

Note: The value "inherit" is not supported in IE7 and earlier. IE8 requires a !DOCTYPE. IE9 supports "inherit".


Property Values

Value Description Play it
length Defines a fixed indentation in px, pt, cm, em, etc. Play it »
% Defines the indentation in % of the width of the parent element Play it »
inherit Specifies that the value of the text-indent property should be inherited from the parent element


Related Pages

CSS tutorial: CSS Text

HTML DOM reference: textIndent property

반응형
반응형

CSS Modal — Pure CSS modal windows

 

http://drublic.github.io/css-modal/

 

 

CSS Modal lets you build modal windows entirely in CSS, without any JavaScript necessary. It works with all screen sizes, and can even be used as a Sass plugin.

css modals

 

Homepage: http://drublic.github.io/css-modal/
GitHub: https://github.com/drublic/css-modal

 

Built with pure CSS

CSS Modal is built out of pure CSS. JavaScript is only for sugar. This makes them perfectly accessible.

Optimized for mobile

The modals are designed using responsive web design methods. They work on all screen sizes from a small mobile phone up to high resolution screens.

Use as Sass plugin

You can use CSS Modal as Sass plugin and apply it to your custom classes. No need to understand all the code.

A few other advantages: accessible, cross-browser, media-adaptive, small and fast!

 

 

반응형
반응형

7 CSS and JavaScript Performance Tips

 

http://webdesignledger.com/tips/7-css-and-javascript-performance-tips

 

Have you ever thought about how many customers you lose by having a slow site? And I’m not talking about file size only, as we rely on browser capacities to understand our code, we need to consider the processing time also.

That’s why sometimes adding a few bites in your code is much better because it save you precious seconds when real browsers or IE try to process your code.

Let’s see a few nice tips on how to improve this:

1. Don’t repeat yourself

You should use the cascade and avoid repeating code. It’s more than just using common classes, you could make good use of the heritance, for instance, so properties that can be set in the parent should be left there. Also you could use the same set of properties for multiple elements (separating multiple selectors using commas, you know).

Also, in your JS make good use of objects, functions and plugins so you don’t need to repeat code.

2. Write from right to left

Unlike us, browsers will process jQuery and CSS selectors from right to left. You may think that this won’t affect your code, but the truth is that it changes everything. A selector like this one is really, really bad:

$(“body #container div a”)

What we think we are writing is “Hey Browser, find the ‘body’ tag, and then inside of it find the #container. There you’ll find a ‘div’ and a couple of ‘a’ elements, let’s select those”. But the browser will actually read the entire page searching for ‘a’ tags, then for each tag it finds it’ll check if it has a div as parent, then check if the div has an element with the #container id, then
check if there’s a body tag beneath them.

7 CSS and JS performance tipsImage from Alex Anistratov

This is just too messy. In the JS we have some elegant solutions, like the find function so your code will actually be read as you wanted. Something like this would be good:

$(“#container”).find(“div”).find(“a”)

When you’re writing CSS you don’t have much options but leaving it as specific as possible, so try finding the closest class or ID you can find.

3. ID’s are really fast

Whenever possible use ID’s, they are faster either in CSS or JS. When using JS you have the possibility of using alternatives rather than jQuery to select tags, like document.body or even passing the entire DOM tree as an array (if you already know the exact location of the element).

4. Keep the selectors short

Keep in mind that sometimes an extra item in your selector will just mess up your code. For instance if you have a “ul li a” selector, you could simply use the “ul a” and you’ll be fine.

The best JS tip we can give you is “don’t use it”. Most times you simply don’t need it and using will cost you a lot more in performance, development time, browser compatibility and maintenance.

You can replace a lot of animations by CSS animations, and you could also use a library like yepnope or modernizr to conditionally load fallbacks for browsers that can’t keep up with your awesomeness.

6. You don’t need to declare your vars, but you should

A lot of people simply skip the var declaration step. That’s ok, but you’ll create a lot of global variables that can break other functionalities and also when the browser has to recover it, it’ll search from local to global scope.

Even if you’ll use a global scope var, you can redefine it locally so you’ll save some time. For example, instead of doing this:

var e1= document.getElementById('ID1'),
e2= document.getElementById('ID2');

Do this:

var doc= document,
e1= doc.getElementById('ID1'),
e2= doc.getElementById('ID2');

So you’ll locally store the document var

7. Do math like you do in your head

We tend to think that programming languages do some kind of black magic and give us the result of complex operations. But the truth is that every single operation has a processing cost. For example, instead of doing 2*15 it’s much easier to do 15+15.

The true tip in this case is, use the more native JS code as you can, so avoid relying on jQuery or other plugins because that will certainly take more time to load and often more code to write.

7 CSS and JS performance tipsImage from Kevin Andersson

BONUS: 8. Remove one image from your source code

The One Less JPG movement is right when they say that removing one image from your source code would save you far more bites than what you’d save by worrying about JS (and CSS). But the truth is: You should do both.

We should always do our best to improve user experience and if that means that an image will look good in the page, and the fancy JS animation has to be removed, so do it.

반응형
반응형

 

HTML 사전 : http://opentutorials.org/module/486

CSS 사전 : http://opentutorials.org/module/441

 

반응형
반응형

http://damirfoy.com/iCheck/

 

Homepage: http://damirfoy.com/iCheck/
GitHub: https://github.com/damirfoy/iCheck/

 

iCheck lets you create highly customized checkboxes and radio buttons using jQuery. It lets you build inputs that are identical regardless of platform, supports touch devices, includes keyboard accessible inputs, and is on 1KB gzipped. There are 15 options for customizing the checkboxes and radio buttons, along with 8 callbacks to handle changes, and 6 methods for making changes programmatically.

icheck

    Plugin features

    • Identical inputs across different browsers and devices — both desktop and mobile
    • Touch devices support — iOS, Android, BlackBerry, Windows Phone
    • Keyboard accessible inputsTab, Spacebar, Arrow up/down and other shortcuts
    • Customization freedom — use any HTML and CSS to style inputs (try 6 Retina-ready skins)
    • jQuery and Zepto JavaScript libraries support
    • Lightweight size — 1 kb gzipped
    • 25 options to customize checkboxes and radio buttons
    • 8 callbacks to handle changes
    • 7 methods to make changes programmatically
    • Saves changes to original inputs, works carefully with any selectors
    반응형

    + Recent posts