Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+4 votes
45.1k views
in Themes by
Hello All,
 
''Recent questions and answers'' text on home page have h1 css class tag, 
How i can change from h1 to e.g. ''something'' which file i need edit ?
 
Thanks.

3 Answers

+2 votes
by
selected by
 
Best answer

It is not quite clear what you're looking for. It seems you want to apply a different CSS style to the h1 tag of the QA section. By different I mean you want to keep the default to the rest of the site. You can't do that without getting your hands dirty and perform a small core hack. You could do this by means of a theme but it will be a bit more complicated.

So here are the steps to add a CSS class only to that section:

1. Open file qa-include/qa-theme-base.php
2. Perform the changes I've made in this Gist:

	

  if (isset($favorite))

	

      $this->output('<form '.$favorite['form_tags'].'>');

	

 

	

- $this->output('<h1>');

	

+ $class = $this->template === 'qa' ? ' class="recent-questions"' : '';

	

+

	

+ $this->output('<h1' . $class . '>');

	

  $this->favorite();

	

  $this->title();

	

  $this->output('</h1>');
3. Open file qa-theme/<your-theme>/qa-styles.css and add the style you want to the recent-questions class:
 
h1.recent-questions {
    color: red;
}

 

by
it's the same as before
by
Can you please tell me how change css class for ''question title'' on question page e.g. here
http://s30.postimg.org/lfoa7mnpd/image.png
this is why i want change all this because i want ''hot'' , ''users'' have other color then ''question title'' on question page maybe is much easer just change this ''question title'' on question page ?

Thanks.
by
This is the CSS class that affects question titles: .entry-title
This site has the following class defined in the css:
.entry-title{
    color:#000;
    font-family:Arial,Helvetica,sans-serif;
    font-weight:700;
}
by
this fix all,

Thanks.
0 votes
by
First open qa-theme/Snow/qa-styles.css and find h1 now you should see the h1 under /* Headings */
by
i need change css class for '''Recent questions and answers'' to some other but i can't found file where i can do this ?
+1 vote
by

If you really want to change tag than follow pupi1985 answer. But If you just want to style differently and tag doesn't matter than you just need to target the body tag. See example below

.qa-template-qa .qa-main h1:first-of-type{
    
    /* add your styling here */
    background-color: #ccc;
    color: green;
    margin: 0 0 10px 0;

    /* if overridden rule doesn't work than use !important */
    background-color #ccc !important;

}

 

by
thanks for the tip :) . It is helpfull .
by
Glad to share.. :)
by
Bot how did you have written the css part that is showing as Highlighted . Where is the option in this site . Could you please let me know ??
by
Ohh . Might be copying a code from a github will be displayed like that
...