Learn 10 simple techniques for CSS for WordPress

Learning CSS may be overwhelmed, especially when you don’t know where to start and and When you encounter difficulties, you need to search for what terms.

Since CSS is a style language, not a full -featured programming language like JavaScript or PHP, it is actually easy to learn, especially if you master some HTML knowledge (I assume you already master you have mastered The purpose of this article).

In our blog survey, the vast majority of people mentioned that you want to improve your game level and be more familiar with CSS. This is why we recently released a list of more than 150 kinds of CSS resources. This should be possible. Help you get started, especially with this post.

Today, I will show you how to help me learn the workflow of CSS when I first started learning CSS many years ago. From the beginning of the skills, gradually master CSS.

Continue reading, or use the following link to jump:

Basic foundation Construction

    Practice simple selector and attributes

  • Remember the box model

  • through practice

  • arrange content according to width and height

  • ] Floating and Positioning
  • Advanced CSS
  • Use CSS Copy Website
  • Pre -processor
  • Congee Building
  • The first thing to do is: to learn how to write your own CSS, you need to know how to format it correctly. In fact, there are two correct ways to do this, but one of them helps you more organized.

Since HTML is usually the first language that people learn when they want to use WordPress website, writing CSS syntax in a similar way to HTML can help learn CSS syntax.

This is the basic structure adopted by CSS:

When you do not want to implement many styles on the site At the time, you will need more than one style you need. This is that the structure like this will become chaotic and fast.

This is why there is a more effective and organized way to write CSS:

Now you can start in depth Study the terms used in this example. Each of these terms is the basic construction block of CSS: class, ID, selector, attributes and values. Attributes and values \u200b\u200balso constitute the so -called declaration.

This is a good starting point to learn how to write your own CSS. Once you start, you may want to know where you should write all these contents in the WordPress file.

In your WordPress installation, any files you see

.css

are CSS files, and you may have guessed. The main file you need to find is your style table, which is marked as

style.css

. This is most or all of your theme design, including color, fonts, basic images, and some possible theme layouts.

You may also notice a prefabrication named custom.css The files in the theme are usually where they want you to make any changes to the theme. When you change this file, it should cover the existing style in the theme style table. If you add the plug -in to your theme, the folder may also have a CSS file, which are used to set the appearance and feeling of the plugin.

2. Practice simple selector and attributes The following is the basic selector and attributes and their role in the theme. For example, for the title

H1

,

H2

, and

H3

, and p used in paragraphs, as well Font-Family and Background-COLOR and other attributes. There is a simple way to practice these new skills and actually view the changes you make without actually creating your own WordPress blog. W3SChools has a lot of information about CSS and real -time examples that can change the code. Just click the button to see the changes you make immediately.

When you seeWhen a sample, just click the \” to try the \” button, and you will open a window. You can test some basic CSS in them. 3. Remember the box model

I advocate the most common information for reference, rather than remembering all the information in my heart. Maybe because I found that my memory is often lacking, but I prefer to say that this is because there are many wonderful reference materials on the Internet.

You can easily find the selector and attributes you don’t know in your heartbeat. Just make a simple query on your favorite search engine (such as GOOGLE or Bing), just click on all the information you need.

Familiar with the box model is important.

Familiar with the box model is important.

This may be the situation of many (or most) things in life, but the box model should not be one of them.

盒子模型 In essence, it is the basic layout element in CSS. You need these elements to understand many attributes. The box layout also includes many basic positions you can use CSS to set styles.

Fortunate You should not have a problem with it. In essence, it includes the content area, inner side distance, border and border. 4. Doing the edge Once you start to be familiar with the CSS, you can actually put it into practice by selecting the topic with a completely basic design and editing its style table to change its style. a good idea. It is important to understand simple changes. Sometimes sometimes have a huge impact on theme, and sometimes it has little impact. In the end, practicing as much as possible can help you see the changes you do intuitively, and link your operation of the code to the final result.

In a more magnificent plan, once you can connect to the point, you can not only write CSS quickly, but also be able to solve problems in the future, which has become a key task for web design and development.

There are some great themes here to practice, you can install it on your WordPress website for free. Not all of them perfectly represent the appearance and function of the theme, but they are a great starting point to learn how to use simple CSS to change themes.

White spectrum

123]

White Spektrum theme is a simple theme with a general layout, including the main content area, sidebarbar, header, and football.

In addition to the colors of fonts and links, this is a simple and easy -to -use theme. Founder

Once you start to really understand CSS, the Founder theme is very suitable It is more complicated than other themes currently listed. It responds quickly, easy to access and prepare for translation, including hamburger icons for mobile screens and many other CSS design details.

白色 Spektrum 标头。 Even if there are the above minimalist themes, you may still be overwhelmed by how many things you haven’t knew. This is okay. When you check each part of this article, it should begin to integrate more.

5. Arrange content according to width and height

Once you install one of these themes, you can also start changing the layout by entering the content area and selector of different lengths and widths.

创始人主题。

This is the next step, which is familiar with the different regions of the WordPress theme.

6. Floating and positioning

This is where CSS will become a bit tricky, because you can use CSS to create layouts, especially floating and positioning. The problem is that these attributes are not designed to create the entire layout, and there is a draft to update the CSS layout.

At present, this is a common way for many people to lay their layout

just right

. Observe the existing themes (including the list above) is a good idea, and see how they are different in the use of floating and positions.

7. Advanced CSS At this point, you really started to master the CSS tips, but there are still many things waiting for you to discover:

pseudo -category

-In specific state of defining elements, such as mouse hovering and positioning images in specific locations related to other elements.

Complex selector

-You can use more advanced selectors to get more specific styles.

CSS3 animation

– When you hang the mouse on the image and button, create a fading, popping, or other transition.

CSS3 MediaOne of the simplest ways to create a response -the theme of response

is to use media query.

  • Transformation -Colon the size and shape of the selected content area.
  • at-rules -It is used to import the theme of the font and style table.
  • Gradient – Add gradient to your theme without using images.
  • These are many elements you can really start seeing the theme design. This is the best time to start testing your skills.
  • 8. Use CSS to copy the website With all these knowledge, you might may You need to get a stronger belt, but more importantly, you can use the basic shell of the theme and add your own CSS style from the beginning to truly put your skills into practice.
  • One of the most helpful things you can do is to practice your knowledge in the real world application. I suggest trying to find a website you like, and then use CSS to copy it as much as possible on a blank WordPress theme. Of course, you may not be perfect for everything, and there may be many elements that cannot be copied only with CSS, but this is a good way to familiarize your CSS.

The following is some great free entry themes you can use:

blank baolite

This is the simplest. Only HTML5 in this theme, so you can add CSS freely without worrying about any style conflict. However, it does provide everything to start designing themes.

  • Interested in blank boards?

    Details

    html5 blank

    html5 blackk It is a model WordPress theme, which contains some styles, but not many. If you are not keen to write CSS from scratch, this is a good start. Interested in HTML5 blank blank?

    Details

    Lower line
  • If you are a bit a bit Adventure and trying to try more advanced entry themes. Underscores is a good choice, but it is not suitable for timid people because it has two pre -loaded theme example styles. It also includes some advanced technologies and codes to make it a good learning tool.

    Interested in the next line?
    Details

    HTML5 reset the WordPress theme on github. It includes more advanced features, but this eventually makes it a valuable entry theme.

    9. Pre -processor

    Once you understand the ins and outs of the CSS, learn pre -processors, especially SASS and Less are a good idea. Both help to organize your CSS, so it is easier to write and edit in the future.

  • The prepositioner makes your CSS clean and easy to understand. It has quickly become the web developer A basic skill. Although the best controversy has always been, SASS is often the most commonly used processor so far.

    If you want to try to use SASS in the WordPress environment, check the Bones theme. It is mainly composed of HTML5, so you can try to use the contained built -in SASS for style settings.

    10. Framework

    In Web development, the framework is to create a structure of a dynamic website. In the end, the goal of the framework is to make the website faster without losing function.

    Once you master the CSS, you can accelerate your theme development by using the framework.

    One of the most popular frameworks is Twitter Bootstrap. It is created as a response formula for opening the box, and uses SASS and LESS and many custom CSS components.

Packing up

With the skills of learning and helping you walk along the way, CSS should not make you difficult to master. In addition, you should now try to design your own WordPress theme.

For more resources about learning CSS and WordPress, please check usOther posts: WordPress Learning and Reference CSS Super Guide: More than 150 resources and Professor from WordPress to professionals: more than 200 occupations improve resources.

What are your obstacles and gains from learning CSS?Share your experience in the comments below at any time.

Tags:

Author:

Leave a Reply

Your email address will not be published. Required fields are marked *