`CSS Stylesheet language notification`

I manage my collection of ebooks using Calibre (http://calibre-ebook.com/). This software allows me to edit epub & azw3 formats as CSS & HTML documents.

Upon running the Debugger, I am presented with a list of Errors & Warnings: (I've omitted most of the CSS file)

@namespace h "http://www.w3.org/1999/xhtml";
.calibre2 {
  height: 422;  <!-- ERROR: CSS: Property: Invalid value for "CSS Level 2.1" 
                            property: 422 [91:5: height]    [stylesheet.css] -->
  width: 601;   <!-- ERROR: CSS: Property: Invalid value for "CSS Level 2.1" 
                            property: 601 [92:5: width]    [stylesheet.css] -->
}
.western {
  color: #000;
  direction: ltr;
  display: block;
  font-family: "Times New Roman", serif;
  font-size: 1em;
  margin-bottom: 0;
  margin-left: 0;
  margin-right: 0;
  margin-top: 0;
  orphans: 2;
  so-language: en-GB;   <!-- WARNING: CSS: Property: Unknown Property name. 
                                      [109:5: so-language]    [stylesheet.css] -->
  text-align: center;
  widows: 2;
}

The Height & Width errors are something I have not delved into much yet, assuming they could be linked to my reading device (Samsung Note).

Regarding the so-language error, I experimented with changing it to lang: en; and :lang en;, but both resulted in errors. I attempted to research "so-language" online, thinking it might have been replaced or deprecated, but found very limited information available on it.

Answer №1

According to the CSS 2.1 guide on width:

Value:   <length> | <percentage> | auto | inherit

[...]
<length> Specifies the width of the content area using a specific length unit.

Additionally, the definition of a length value (represented by <length> in this document) is described as a <number> (with or without a decimal point) immediately followed by a unit identifier (e.g., px, em, etc.). The unit identifier becomes optional after a zero-length measurement.

To clarify, omitting the unit is only acceptable when the length is equal to zero.

Upon conducting tests in various web browsers, it was observed that they automatically correct an improper width value by assuming pixels. While appending a px suffix may fix the issue, it's advisable to locate class="calibre2" in the codebase and determine its intended purpose to avoid any potential disruptions.

In regards to the mention of so-language, comprehensive information on this attribute seems lacking aside from scattered examples found in e-books, suggesting it may be an Amazon-specific feature. Calibre likely employs a standard third-party CSS validation tool which may not recognize non-W3C compliant elements. Consequently, disregarding the warning associated with so-language is likely justified.

Answer №2

The primary function of language tagging in CSS serves a specific purpose.

.western:lang(en-GB) { ... }

If an html-element contains a lang attribute, it will be styled accordingly.

For instance:

<span lang="en-GB">English</span>

As @Vall3y mentioned, attributes such as Position and dimension require specified units, such as px, %, or em.

It's challenging to provide a comprehensive answer without a clear question stated in your post.

Answer №3

The errors related to height and width that you have pointed out are actually part of a calibre class applied to an image tag in your epub or azw3 source. Typically, an image tag will have the following structure:

 <img src="foo.gif" height="422" width="601"> 

It's worth noting that you don't need to add a "pixels" suffix like px for the height and width values in an image tag because they are considered pixels by default. However, in your ebook, it seems to be rendered as:

 <img src="foo.gif" class="calibre2"> 

This is combined with the following CSS:

.calibre2 {
 height: "422";
 width: "601"
}

resulting in a parsing error from the CSS parser. When height and width properties are assigned to CSS classes in this manner, it can cause parsing issues in calibre. While this may not affect eReaders, you can resolve the error by moving the height and width properties back into the html files in the epub/azw3 format. Alternatively, you can eliminate the error messages by modifying the CSS class as follows:

.calibre2 {
  height: 422px;
  width: 601px;
}

Adding px to specify the unit for the height and width in the image tag, although not mandatory, is harmless. Regarding the so-language property, you can simply replace it with blank text using calibre's editor. Despite being ignored by eReaders, it should not pose any issues.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is there a more efficient method for creating HTML with coffeescript / jQuery besides using strings?

Today marks my first attempt at creating a "answer your own question" post, so I hope I am on the right track. The burning question in my mind was, "Is there a more efficient way to generate HTML with jQuery rather than using tag strings?" My goal is to c ...

Ensuring that two operators are not consecutively placed in a Javascript calculator-validation guide

After creating a basic calculator using HTML, CSS, and JavaScript, I encountered an issue. When validating user input, the calculator currently accepts multiple operators in a row. To address this, I attempted to prevent consecutive operators by checking ...

Connect ngx-time picker to form input in Angular

Currently, I have successfully implemented Angular material date pickers in my project, however, I am facing a challenge with integrating time pickers as it is not natively supported by Angular Material for version 8. To address this issue, I am utilizing ...

Obtain Identifiers for LI Data from Dynamic Content

I am currently working on a functionality where the user can assign deliveries to different vans based on the number of vans they have available for the day. However, I am facing an issue where the button does not seem to be functioning properly as it is n ...

Utilizing "beneath the scroll" on a bootstrap 5.1 webpage

I have a website built with Bootstrap and I am looking to implement a "below the flow" positioning for the footer, preferably using CSS. I have been referring to it as "below the fold," although I'm not sure if that is the correct terminology to use. ...

Angular state correctly maps to the controller but is not reflected in the HTML

I'm currently in the process of setting up a basic Angular application, something I've done many times before. I have defined a home state and another state for a note-taking app, but I am facing an issue where neither state is displaying or inje ...

Unsuccessful CSS integration with Django webpage

I have created a navigation bar using HTML and CSS, but I am having trouble getting the CSS to affect the HTML. I have checked my static files setup and tried various settings, but nothing seems to work. Any assistance would be greatly appreciated. As a be ...

Unable to drag and drop onto every part of a div element that has undergone a CSS transformation

Having trouble implementing a Drag & Drop feature. The droppable div is styled with CSS transformations, but the draggable div doesn't drop correctly on the right part of the box. If you'd like to take a look at the code and try it out yourself, ...

Wordpress problem with Bootstrap JavaScript code involving data-toggle="collapse"

Currently facing an issue with my project. This is my first attempt at creating a WordPress blog, inspired by the HTML site www.humantools.com.mx and building a blog for it at www.humantools.com.mx/blog. There's a strange problem: when logged in, the ...

Tips for using JQuery to update an HTML window from a separate window

After creating a new window with the code var w = window.open("", "_blank");, it initially displays the URL about: blank and allows me to easily write to its body. However, when examining the sources, I notice that it only contains `` with no content to ma ...

Style an image in CSS based on the value of its alt attribute when

Is there a way to style an <img> tag using CSS based on its alt attribute value? For example, I have images with ALT values of "DISAPPEAR". I would like to hide the image when it is hovered over using the following CSS: img[alt="DISAPPEAR"]:hover ...

Rows in a table materialize and fade away

Why does the row show for less than one second and then disappear when I click on the button? Everything works fine when I delete the form tag. How can I make it work without having to delete the form tag? Check out the code below: <html> <head ...

When I bind the submit event to my form, the form is automatically submitted using the default handler

This issue occurs in both IE and Firefox, but not in Chrome. Here is the form structure: <form id="enviaEmail" method="post"> <label for="nombre">Nombre</label> <input id="nombre" type="text" name="nom ...

The code behind for a table using bootsrap causes elements to overlap with the div element above it

I have a division structured like this: <div style="border:0px solid #ff0000;width:60%;margin: 0 auto;"> <div class="div_container" style="width:100%;border:1px solid #ff0000;" id="div_dynamic_table" runat="server"> ...

Jquery code malfunctioning following an ajax request

Can someone help me troubleshoot an issue I'm having with this Jquery script? It seems that after making an ajax call and replacing the old content, the "slideToggle()" function is not working properly. Despite this, other functions like adding and re ...

Utilizing React Classes Based on Conditions

I'm attempting to add the class active if commentBadgeActive is true. The Scholar image should transition from grayscale to colored. <Paper className={classes.paper}> <div className={classes.profile}> < ...

The last value label in Google Charts bar chart getting cut off

I've searched extensively for a solution to this issue regarding the haxis labels, but I have not been able to find one that addresses it... In the image provided below, you'll observe that the last percentage label on the horizontal axis is mis ...

Utilizing Touch Inputs to Resize Panels in GWT

Recently, I encountered a challenge with the size of my Panel while loading numerous widgets inside it. To address this issue, I opted to utilize a Resizable Panel in GWT, which initially proved to be effective. However, my current dilemma lies in adaptin ...

Use Javascript to display specific div elements by clicking a button

I could really use some assistance, When I attempt to display the select div by clicking the button, the "id" that PHP generates returns a null response in the console. The requirement is to only show the div when clicking on the "Quick Quote" button. Pro ...

Click to load an IFRAME upon clicking

I am encountering an issue with IFRAMEs loading onClick. The problem lies in the script provided below which always loads the content of the first iframe, whereas my expectation is to load only the iframe corresponding to the link clicked. $('.toggle ...