Title: Which is better,  functions.php or  style.css
Last modified: August 20, 2016

---

# Which is better, functions.php or style.css

 *  Resolved [another-webmaster](https://wordpress.org/support/users/another-webmaster/)
 * (@another-webmaster)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/which-is-better-functionsphp-or-stylecss/)
 * Is it better (faster/more stable) to use a CSS code or function for following?
   
   To create two columns I have a function as following (just part of full code 
   shown here): (left column) `$content = '<div style="width: 45%; margin-right:
   5%; float: left; text-align: justify; ">' . $content . '</div>';` (right column)`
   $content = '<div style="width: 45%; float: left; text-align: justify;">' . $content.'
   </div><div style="clear: both;"></div>';` Using it with a shortcode it works 
   like a charm but it is still a function. I could also use CSS code itself and
   create div+class in style.css (I only edit in html mode. I never use crappy visual
   editor).
 * Does it matter which way I use or is it prefer to use the style.css above functions.
   php?
    Looking forward to answers, thanks in advance.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Moderator [Kathryn Presner](https://wordpress.org/support/users/zoonini/)
 * (@zoonini)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/which-is-better-functionsphp-or-stylecss/#post-2446459)
 * I would add a class to your function and put the styles in your CSS as it’s always
   preferable to keep functionality and form separate.
 * i.e.
 *     ```
       <div class="foo">
   
       .foo {
         width: 45%;
         margin-right: 5%;
         float: left;
         text-align: justify;
       }
       ```
   
 *  Thread Starter [another-webmaster](https://wordpress.org/support/users/another-webmaster/)
 * (@another-webmaster)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/which-is-better-functionsphp-or-stylecss/#post-2446492)
 * You are so right with that, absolutely maam! but (sorry no offence) still it 
   is as a function call.
    Maybe I didn’t explain what/how I meant the question 
   above, sorry for that. To enlighten some by this sample;
 * In a post/page we can do it 2 ways, the first way could be like this:
    _(for 
   left column):_ `<div class="lcol"> the text here </div>` _(for right column):_`
   <div class="rcol"> the text here</div>` And in style.css giving the correct codes
   for the classes, no shotcode is used this way.
 * Second way can be done like this, clicking the created button (we did ourselfs,
   btn are lcol and rcol):
    `[lcol]{txt here}[/lcol]` and `[rcol]{txt here}[/rcol]`
 * Using the shortcode methode is for our authors faster with same output results.
 * But I actualy was/am curious if a plugin/function call needs more “load” from
   server than just the “regular” styling way by using “only” css code, as shown
   in the sample as above now.
    I ask that because our site (as it is now) has over
   2/3k postings and I am a little afraid that plugins/function calls like these
   also will have a neg impact on server loads but maybe I am totally incorrect.
 *  Moderator [Kathryn Presner](https://wordpress.org/support/users/zoonini/)
 * (@zoonini)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/which-is-better-functionsphp-or-stylecss/#post-2446507)
 * Ah – thanks for clarifying. Unfortunately I don’t know the answer to this one
   but hopefully someone else will chime in. I’ll see if some other folks might 
   know.
 *  [Ron Rennick](https://wordpress.org/support/users/wpmuguru/)
 * (@wpmuguru)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/which-is-better-functionsphp-or-stylecss/#post-2446513)
 * Putting it in your css reduces your server load because the browser will only
   load that css once (and keep it in cache).
 * You can change your shortcode so that it outputs
 * `<div class="lcol"> the text here </div>`
 * instead of the inline styles.
 *  Thread Starter [another-webmaster](https://wordpress.org/support/users/another-webmaster/)
 * (@another-webmaster)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/which-is-better-functionsphp-or-stylecss/#post-2446705)
 * Thank you both for fast responding, will split up function and styling to where
   both belong 🙂

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Which is better, functions.php or style.css’ is closed to new replies.

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 5 replies
 * 3 participants
 * Last reply from: [another-webmaster](https://wordpress.org/support/users/another-webmaster/)
 * Last activity: [14 years, 6 months ago](https://wordpress.org/support/topic/which-is-better-functionsphp-or-stylecss/#post-2446705)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
