Home Tutorials CSS Simple & Effective CSS Tricks for your Website CSS is a widely used method of presenting website pages. Though an important tool of web design it has been termed as a language for the diligent. Weebly flexibility and easy of use for non programmers drag drop, Weebly hosting service Weebly blog and Site Woo-comers Sites etc, provides an excellent platform on which to start a blog,Site And. The website builder platform was born in 2007 and now powers more than 50 million sites around the world. Whether you’re starting an online business from scratch, building a professional portfolio, or looking to refresh your existing organization’s online presence, Weebly supplies the design tools and customizations to get you there.
Beautify your CSS code:
Enter your messy, minified, or obfuscated CSS Style Sheets into the field above to have it cleaned up and made pretty. The editor above also contains helpful line numbers and syntax highlighting. There are many option to tailor the beautifier to your personal formatting tastes.
Customizing the style is pretty easy once you have the CSS snippets you want to use. All you need to do is to copy the most appropriate CSS snippets for your site and paste it into your Additional CSS section in the customize panel by navigating to Appearance » Customize » Additional CSS. Then just click Save & Publish, and you’re done. Step 1: The HTML and Basic Squares. Let's start with the simplest version that works across all browsers. As we are using HTML5 for the effect, the basic HTML of our sticky notes is an unordered list with a link containing all the other elements in each list item.
When do you use
Often when writing CSS Style Sheets your indentation, spacing, and other formatting can become a bit disorganized. It is also common for multiple developers to work on a single project who have different formatting techniques. This tool is helpful for making the formatting of a file consistent. It is also common for CSS Style Sheets to be minified or obfuscated. You can use this tool to make that code look pretty and readable so it is easier to edit.
The minified CSS Style Sheets below:
Becomes this beautified:
As time goes by, CSS is becoming more and more powerful and nowadays it offers lots of possibilities to create visually stunning websites.
This article is a compilation of fresh, advanced CSS tips and techniques to master your web design and front-end web development skills. Each technique features sample code snippet, demo, and explanations.
Vertically Align With Flexbox
Centering a text or element vertically has always been quite a pain for many front-end developers. Introduced in the CSS3 specification, the
display: flex property/value provides an easy way to vertically align any element.
Consider the following HTML:
And the related CSS:
display: flex specifies a Flexbox layout for the element, and
align-items: center takes care of the vertical centering. Click here to view a demo of this technique.
Using SVG for Icons and Logos
SVG is supported by all modern browsers and scales well for all resolution types, so there’s no reason to continue using
.gif images for logos or icons.
The code below represents the CSS code used to display a website logo:
Note the use of the
background-size property, which is used to scale the background image to fit the container size.
Curve Text Around a Floating Image
shape-outside is a CSS property that allows geometric shapes to be set, in order to define an area for text to flow around.
Here’s the result of the
.shape class applied to the image:
Source: Web Designer Depot
Smooth Color Change On :hover
transition property allows front-end web developers to create smooth and visually appealing hover effects on links or any other element.
Let’s have a look to a basic CSS transition to make links or any other element look better. This smooth color change is used on CatsWhoCode’s links.
5 Css Tricks That Will Instantly Beautify Your Weebly Site Free
This technique can be used to create much more advanced hover effects. Using
transition, you can animate many properties (width, height, background, etc) of a given element.
For more advanced CSS transition examples, feel free to check our CSS transition guide.
Gradients and Gradient Text
A decade ago, the only way a web designer or web developer could create a gradient background was to use Photoshop to create an image, which was then displayed on a website using the
Thanks to the CSS3 specification, it is now possible to create gradients in HTML/CSS, resulting in fewer resources, faster loading times and better user experience.
The following CSS is used to create a gradient which is applied to the document’s body:
linear-gradient() function creates a linear gradient and defines it as the background image for
body. The function takes 3 arguments: a direction or an angle, and 2 color stops.
Using CSS gradients and WebKit specific properties, it is possible to apply the gradient to a text:
Click here to access the demo for this technique. Please keep in mind that text gradients aren’t supported by all browsers.
Since the release of the CSS3 specification, you can natively animate HTML elements in pure CSS. As of 2019, CSS animations are supported by all browsers.
Check out the demo or have a look at the following code:
As you can see, the code starts by
@keyframes example: This creates an animation that can be applied to any HTML element.
On lines 10 and 11, you can spot the use of
animation-name which specifies which animation to use, and
animation-duration which defines for how long the animation should run. Once the animation is finished, the element changes back to its normal state.
For advanced CSS animations examples, I recommend this collection which features beautiful web design trends and various animation tips and tricks.
Style Broken Images
Broken images don’t look good on a website, but it can happen every now and then that an image is missing from the server and can’t be displayed.
Using some advanced CSS, it is possible to style broken images and provide custom error messages to your visitors.
This example makes use of the
:after pseudo-classes, which are used to display error messages to the end user.
attr() CSS function is used to return the value of the
src property, thus displaying the faulty url.
Truncate Strings in CSS
Web designers and front-end web developers often encounter this common problem: A text is too big for its container. Using CSS, this problem can easily be fixed.
5 Css Tricks That Will Instantly Beautify Your Weebly Site Website
Let’s have a look at the following CSS class, created by web designer Chris Coyier:
The class defines a fixed width and prevents the text from overflowing the container. On line 5,
text-overflow: ellipsis; automatically adds ellipsis at the end of the text in order to indicate that it has been truncated.
Click here to see this technique in action.
Source: Chris Coyier
A strong point of CSS preprocessors is the possibility of using variables to create re-usable values and avoid code redundancy.
While tools like SASS are very useful for front-end web development, they aren’t required for using variables, as this can be done in native CSS.
Consider the CSS below:
Variables are declared by giving them a name preceded by two dashes. In this example, the main color, main background color, and base padding are declared.
When wanting to use a previously created variable, use the
var() function as shown on lines 8 to 10. Click here to view the live demo of this technique.
Full Height Containers
vh is a little known unit that can be used in CSS. 1
vh represents 1% of the viewport height, regardless of the screen size.
Lajanje na zvezde online. Using this unit, it is easy to create full-height containers:
vh stands for 1% of the viewport height, the code above defines a container that will take 100% of the vertical height of the screen.
A similar unit called
vw is used for creating full-width containers.
Smart Quotes in HTML/CSS
5 Css Tricks That Will Instantly Beautify Your Weebly Site Work
Smart quotes are an integral part of beautiful typography and modern web design, as they provide readability and better user experience.
Using the HTML
<q> tag (Which defines a short quotation) and some CSS, it is easy to force the browser to display the short quotation within smart quotes:
You can see the above example in action on this demo.
Bullet point lists are very widely used online, as they provide a great way to display information in a clear and concise manner.
The following CSS snippet will add comas on every item of an unordered list, except for the last one. This is achieved by using
:not(:last-child) to ensure that a comma will be applied to all items but the last one.
You can check out the demo of this technique.
5 Css Tricks That Will Instantly Beautify Your Weebly Sites
This is totally scary and not something you should ever try except as a proof of concept. Let’s have a look at the following code: Using CSS attribute selectors, it’s possible to request resources from an external server under the premise of loading a background image.
The code above will select all user inputs with a type that equals password and value that ends with a.
It will then try to load an image from
Source: Max Chehab