Wednesday, November 10, 2021

Group CSS Selectors

 

How to Group CSS Selectors

To group CSS selectors in a style sheet, use commas to separate multiple grouped selectors in the style. In this example, the style affects the p and div elements:

div, p { color: #f00; }
0 seconds of 2 minutes, 13 secondsVolume 0%
01:46
 
How to Do 2-Digit Addition Without Grouping

In this context, a comma means "and," so this selector applies to all paragraph elements and all division elements. If the comma were missing, the selector would instead apply to all paragraph elements that are a child of a division. That is a different kind of selector, so the comma is important.

You can group any form of selector with any other selector. This example groups a class selector with an ID selector:

p.red, #sub { color: #f00; }

This style applies to any paragraph with the class attribute of red and any element (because the kind is not specified) with an ID attribute of sub.

You can group any number of selectors, including selectors that are single words and compound selectors. This example includes four different selectors:

p, .red, #sub, div a:link { color: #f00; }

This CSS rule would apply to:

  • Any paragraph element
  • Any element with the class of red
  • Any element with an ID of sub
  • The link pseudo class of the anchor elements that are descendants of a division.

That last selector is a compound selector. As shown, it's easily combined with the other selectors in this CSS rule. The rule sets the color of #f00 (red) on these four selectors, which is preferable to writing four separate selectors to achieve the same result.

Any Selector Can Be Grouped

You can place any valid selector in a group, and all elements in the document that match all the grouped elements will have the same style based on that style property.

Some designers prefer to list the grouped elements on separate lines for legibility in the code. The appearance on the website and the load speed remains the same. For example, you can combine styles separated by commas into one style property in one line of code:

th, td, p.red, div#firstred { color: red; }

or you can list the styles on individual lines for clarity:

th,
td,
p.red,
div#firstred
{
color: red;
}

Why Group CSS Selectors?

Grouping CSS selectors helps minimize the size of your stylesheet so it loads faster Admittedly, style sheets are not the main culprits in slow loading; CSS files are text files, so even very long CSS sheets are tiny when compared to unoptimized images. Still, every bit of optimization helps, and if you can shave some size off your CSS and load the pages that much faster, that's a good thing.

Grouping selectors also makes site maintenance far easier. If you need to make a change, you can simply edit a single CSS rule instead of multiple ones. This approach saves time and hassle.

The bottom line: Grouping CSS selectors boost efficiency, productivity, organization, and in some cases, even load speed.

Monday, October 18, 2021

UTF-8 Symbols

 › for arrow

https://www.w3schools.com/charsets/ref_utf_punctuation.asp

Try it - https://www.w3schools.com/charsets/tryit.asp

Saturday, October 16, 2021

Instagram Embed fluid width

 Add this to your css file:

.instagram-media {

    max-width: 100% !important;

    width: 100% !important;

    min-width: auto !important;

}

Good thread here:

  • https://theme.co/forum/t/instagram-embeds-not-sizing-properly-on-mobile/60299/12


Good resources:

  • http://embedresponsively.com/
  • http://fitvidsjs.com/

Sunday, August 8, 2021

Fluid Iframe

 CSS

.videoWrapper {

position: relative; padding-bottom: 56.25%; /* 16:9 */ height: 0; } .videoWrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

HTML

<div class="videoWrapper"> <!-- Copy & Pasted from YouTube --> <iframe width="560" height="349" src="http://www.youtube.com/embed/n_dZNLr2cME?rel=0&hd=1" frameborder="0" allowfullscreen></iframe> </div>

Tuesday, June 8, 2021

List of Countries - TXT


Afghanistan
Albania
Algeria
Andorra
Angola
Antigua & Deps
Argentina
Armenia
Australia
Austria
Azerbaijan
Bahamas
Bahrain
Bangladesh
Barbados
Belarus
Belgium
Belize
Benin
Bhutan
Bolivia
Bosnia Herzegovina
Botswana
Brazil
Brunei
Bulgaria
Burkina
Burundi
Cambodia
Cameroon
Canada
Cape Verde
Central African Rep
Chad
Chile
China
Colombia
Comoros
Congo
Congo {Democratic Rep}
Costa Rica
Croatia
Cuba
Cyprus
Czech Republic
Denmark
Djibouti
Dominica
Dominican Republic
East Timor
Ecuador
Egypt
El Salvador
Equatorial Guinea
Eritrea
Estonia
Ethiopia
Fiji
Finland
France
Gabon
Gambia
Georgia
Germany
Ghana
Greece
Grenada
Guatemala
Guinea
Guinea-Bissau
Guyana
Haiti
Honduras
Hungary
Iceland
India
Indonesia
Iran
Iraq
Ireland {Republic}
Israel
Italy
Ivory Coast
Jamaica
Japan
Jordan
Kazakhstan
Kenya
Kiribati
Korea North
Korea South
Kosovo
Kuwait
Kyrgyzstan
Laos
Latvia
Lebanon
Lesotho
Liberia
Libya
Liechtenstein
Lithuania
Luxembourg
Macedonia
Madagascar
Malawi
Malaysia
Maldives
Mali
Malta
Marshall Islands
Mauritania
Mauritius
Mexico
Micronesia
Moldova
Monaco
Mongolia
Montenegro
Morocco
Mozambique
Myanmar, {Burma}
Namibia
Nauru
Nepal
Netherlands
New Zealand
Nicaragua
Niger
Nigeria
Norway
Oman
Pakistan
Palau
Panama
Papua New Guinea
Paraguay
Peru
Philippines
Poland
Portugal
Qatar
Romania
Russian Federation
Rwanda
St Kitts & Nevis
St Lucia
Saint Vincent & the Grenadines
Samoa
San Marino
Sao Tome & Principe
Saudi Arabia
Senegal
Serbia
Seychelles
Sierra Leone
Singapore
Slovakia
Slovenia
Solomon Islands
Somalia
South Africa
South Sudan
Spain
Sri Lanka
Sudan
Suriname
Swaziland
Sweden
Switzerland
Syria
Taiwan
Tajikistan
Tanzania
Thailand
Togo
Tonga
Trinidad & Tobago
Tunisia
Turkey
Turkmenistan
Tuvalu
Uganda
Ukraine
United Arab Emirates
United Kingdom
United States
Uruguay
Uzbekistan
Vanuatu
Vatican City
Venezuela
Vietnam
Yemen
Zambia
Zimbabwe

Saturday, May 22, 2021

Learnpress

 Databases:

Check the post table, I believe most the data is writing into mysql as a custom post type, with prefix - "lp-"

Tuesday, May 18, 2021

Woocommerce Tabs

Remove Woocommerce Tab Headings

 /** below

 * @snippet       Remove "Description" Title @ WooCommerce Single Product Tabs

 */

 add_filter( 'woocommerce_product_description_heading', '__return_null' );

add_filter( 'woocommerce_product_additional_information_heading', '__return_null' );


Rename Woocommerce Tab Headings

// Change the product description title

add_filter('woocommerce_product_description_heading', 'change_product_description_heading');

function change_product_description_heading() {

 return __('NEW TITLE HERE', 'woocommerce');

}

Remove Woocommerce Reviews Tab Heading

add to CSS

.woocommerce-Reviews .woocommerce-Reviews-title{

display: none;

}