Creating buttons and action links
Jump to: Types of button links | Working with Buttons | Multi-button alignment
Stanford Sites provides a variety of styles you can use on your links. These styles include button and action link styles.
- Add a link to the text. (See Creating links in text)
- Select the link.
- From the Style dropdown in the Text Area toolbar, select a link style of your choice. Styles include Button, Big Button, Secondary Button, and Action Link.
- Save.
Types of button links
Button link
The Button link style can be applied to any link you have already created and can be found in the "Styles" dropdown in the editing tool. Use the Button link style to call out a link prominently on the screen.
Big Button link
The Big Button link style can be applied to any link you have already created and can be found in the "Styles" dropdown in the editing tool. Use the Big Button link style to call out a link even more prominently on the screen. We recommend reserving the use of this button to links that require significant visual contrast. Maybe one or two instances on your site could solicit the need for this button style:
Secondary Button link
The Secondary Button link style can be applied to any link you have already created and can be found in the "Styles" dropdown in the editing tool. Use the Secondary Button style for any link that requires prominence, but not as much as a solid-color button. A Secondary Button could be one that provides a second option to users that may not be the primary user task. An example of this could be listing an "Apply" button using the default Button link style, followed by a "Learn more about admissions" button using the Secondary Button link style.
Normal Text Link style
This is the Normal Text Link style that will automatically appear after you have selected text and turned it into a link. Use the Normal Text Link style inside bodies of text, or as a link by itself.
Action Link style
The Action Link style ads additional visual indication of a link. We recommend using this style on a line of its own or in a list.
Working with Buttons
By default, buttons added to a text area that are enclosed within the same paragraph tag (<p>) appear inline (on the same line). Through editing the text source code directly, experienced editors can modify the button layout further.
Inspecting and modifying Text Area source code
The text editor creates HTML code from the styles and text that you add to the editor. There may be times you'll need to fix mistakes and to edit the HTML directly. Here's how to view and edit the HTML source code.
- Identify the Text Area you would like to modify, and click Edit.
- Create buttons as normal.
- Within the Body text toolbar, click Source to display your Text Area as HTML.
Placing multiple buttons
On your Stanford site you can place multiple buttons inline and stacked.
Inline button example
- Type the button text for all of your buttons on one line, with a space between each button's text.
- Once all button text has been added on the same line, add the links and button styling.
- All of your buttons should now appear on one line.
Stacking buttons
The spacing between stacked buttons appears differently depending on whether the buttons are enclosed within one paragraph tag ("<p>"), or separate paragraph tags. Stacked Buttons that are enclosed within separate <p> tags have more spacing, while buttons enclosed in one <p> tag have less spacing.
Option #1: Stacking buttons spaciously (enclosed in separate <p> tags)
- Type the button text for your first button, and press the enter/return key.
- Continue adding button text in this manner for all buttons you would like to be spaciously stacked together. Pressing the enter/return key ensures that additional buttons will be enclosed within their own paragraph.
- Once all button text has been added on separate lines, add the links and button styling.
- Buttons should now appear spaciously stacked.
Option #1 example
Option #2: Stacking buttons closely (enclosed in one <p> tag)
- Type the button text for all of your buttons on one line, with a space between each button's text.
- Once all button text has been added on the same line, add the links and button styling.
- All of your buttons should now appear on one line.
- In the editor toolbar, select Source. This will change the editor from a WYSIWYG editor to an HTML editor.
- Add class="su-stack-button" to the initial paragraph tag. It should now look like this:
<p class="su-stack-button">
<a class="su-button" href="https://example.com">Example Button 1</a>
<a class="su-button" href="https://example.com">Example Button 2</a>
<a class="su-button" href="https://example.com">Example Button 3</a>
</p>
Buttons should now appear closely stacked: