Hi,

I have a website is php+mysql and i would like to do some changes on css.
Ex. To add H1 and H2 tags.
Here is the css where i want to add the h2 and i dont have idea how.
If you need a more detailed description let me know please.
Thanks a lot

A.cat_parent_link { /* The parent category name */

    font-family: "verdana", sans-serif;
    font-size: 10pt;
    font-weight: bold;
    color: #0000FF;

Dani AI

Generated

Two practical ways to make the right‑hand category labels behave like headings — and why they’re different.

First, the proper, semantic solution (best for accessibility and SEO) is to change the PHP template that prints those category links so each item is output inside a level‑two heading element that contains the link. That makes the page structure meaningful to screen readers and search engines, and then the stylesheet can target the heading (or the heading’s child link) for sizing, spacing and color. was right to point out that CSS does not “insert” tags; the markup must be emitted by the server.

Second, if the CMS/template cannot be edited, mimic the visual look of an H2 in CSS. Increase the link’s font size (roughly 1.1–1.4em), use a heavier weight (700), make the anchors block‑level so you can add vertical spacing, and keep a clear focus outline for keyboard users. Don’t remove link cues (like color or underline) without providing an accessible alternative. Styling-only changes are fine visually, but they don’t provide the semantic benefits of real heading elements.

A couple of practical cautions: categories that are a list should remain in a list container for proper structure; avoid sprinkling headings arbitrarily — keep heading levels logical; and if headings are used purely for appearance, search engines and assistive tech won’t treat them as structural unless they’re real elements in the HTML. In short: prefer editing the template to emit H2s when possible; use CSS-only styling as an acceptable fallback when template edits aren’t feasible. ’s goal is reachable either way, and ’s explanation about CSS vs HTML is the right foundation for the decision.

Recommended Answers

All 10 Replies

Are you saying you just want to style a heading tag?

Please explain further and you can even post your code using the code button or better a link to your site.

Yes making some text from regular to H1 or H2
Sry for not being specific.

link is here.

and all the links on the right side starting with accounting and finishing with transportation i would like to make them H2

Not sure why you would want to make them all heading element. They are lists and really should be in an unordered list. But all you have to do is wrap each one like so:

<h2>Accounting / Finance/ Ban...</h2>

Ok thx but using this css

A.cat_parent_link { /* The parent category name */

	font-family: "verdana", sans-serif;
	font-size: 10pt;
	font-weight: bold;
	color: #0000FF;

}

what should i change or add the

<h2>Accounting / Finance/ Ban...</h2>

<h2>Accounting / Finance/ Ban...</h2>

I'm not following you. You cant use CSS to "insert" html into your document, if thats what you're trying to do.

Again, maybe I am misunderstanding you.

Well.. maybe i am not expressing myself as it should be.
Let me understand. Those categories i cannot make them H2 using css?

thx

You cant insert any html tags into a page using CSS no. CSS is used to style already existing html elements including tags classes and id's.

Now, what you can do if you want to emulate what the heading tag looks like is something like you pretty much have.

font-weight:bold;
font-sixe: 10px;

You can increase the 10px to something higher, and the font-weight can be bolder instead of just bold.

Got it.

I understand now and thx for patience ;)
But let me ask you how this title it has an H1 tag ?

Thanks

The <h1></h1> tag is coded in by the designer....into the html not the css. Then you can style the h1 tag WITH css. Like it is here in your site:

h1, h3 {
    font-size: 14px;
    font-weight: bold;
    margin: 0;
    padding: 0;
}

Dont get confused and mix up what css is and does and what html is and does. You should do some reading here for html, and here for css to get some basic understanding of each.

Okay. Very ..to the point. I'll have a look, print out and have some bedtime reading.
Thanks a lot.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.