Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialForest Hoy
1,303 PointsHow do you copy and paste code?
I was wondering because I wasn't sure what to do if I had a question. I have been re-watching the videos and found my answer but for the future I would like to know.
katherine
45,330 Pointson a mac, command + c to copy and command + v to past. and to select all the text on a page use command + a
2 Answers
evanfiddler
22,275 PointsAre you asking how to copy/paste in general? If so, the previous answers will work---but I don't think that's what you're asking. I think you're asking how to put code into this forum:
First you type 3 backpacks (```)
Then type your code.
Followed by 3 more backticks (```)
For instance:
```
This is code!
```
Or if you'd like to use syntax highlighting, just place the language after the first set of backticks:
```javascript
'use strict';
var express = require('express')
var app = express();
app.get('/', function(req, res){
res.send("<h1>Foo bar!</h1>");
});
//more code goes here
```
or...
```html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Title Here</title>
<script type="text/javascript">
if (foo) {
bar(1 + 5)
}
</script>
</head>
<body>
<h1>A header here</h1>
<div id="container" class="col">
<p>Markdown is fun.</p>
</div>
</body>
</html>
```
Hope that helps a little.
Forest Hoy
1,303 PointsYeah, that does help. Thank you.
Kevin Faust
15,353 PointsKevin Faust
15,353 Pointsctrl-c and ctrl-v?