I feel like an updated answer is warranted here. These are obviously guidelines and opinions, but also informed by my observations of what conventions are defacto community standards and/or widely adopted.
PHP
Variables, functions and method names should be camelcase:
$myVariable = 'foo';
Class names and interfaces should be Pascal Case
class MyClass implements MyInterface { .. }
PHP has two widely adopted standards that cover this and much more in regards to code standardization, and many of these standards are followed by the major PHP project like Laravel and Symfony. Those standards are documented in PSR-1 and expanded/revised in PSR-12.
HTML
HTML5 is the document standard, which also expanded content specific tags.
Beyond that, there's been a move towards lowercasing everything, where in the early days people often uppercased the names of any tags, even though that didn't matter.
As of 2023, lowercase your names. If you have multiple words in a name separate the words with hyphens.
Consider attribute naming of things like the data attributes as representing the emergence of this convention.
<div id="my-products" name="my-products" data-category="5">
CSS
I've seen fairly wide adoption of BEM as well as the emergence of css frameworks beyond bootstrap, like materialUI and Tailwind.
BEM also is helpful in thinking about how to organize styles for html "components" where you have a nested grouping of elements that equate to a page component.
<style>
.btn {
border: none;
color: white;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
padding: 12px 28px;
cursor: pointer;
}
.btn--submit {
background-color: green;
}
/* a product card component with styles for each child element of the component */
.product-card { .. }
.product-card__title { .. }
.product-card__image { .. }
.product-card__price { .. }
.product-card__description { .. }
.product-card__order-button { .. }
/* used if item out of stock */
.product-card__order-button--disabled { .. }
</style>
Javascript
Javascript and PHP conventions are very similar. Google has published a js coding style guide similar to those that came from the PHP framework interop group I linked to above.
The major js frameworks (angular, react, vue, etc) sometimes have conventions specific to them, that are worth researching.
Variables camelcase
let myObj = { name: 'Michael' }
Classes uppercase
class MyClass {
constructor() { .. }
}
PYTHON
The Python manual has a link to 2 extension proposal documents
To summarize the basics:
Variables and functions should be lowercase with underscores between words
Use Pascal Case/Studly caps for Classes
my_variable = 'Something'
class MyClass:
Python styles is explored more fully in this question.
I only included the languages most typically involved in Web Development as that was the focus of the original question, as well as the accepted answer.