Is it possible to use the web3.js library in a client's browser to let them generate an address and sign a transaction without them connecting to an ethereum node?
Not in web3.js. EDIT: As answered by @Andromelus, web3js 1.0 can do it with the following function:
web3.eth.accounts.signTransaction(tx, privateKey [, callback]);
There are other libraries such as, https://github.com/ethereumjs/ethereumjs-tx and https://github.com/SilentCicero/ethereumjs-accounts, that can be used. See Create and sign OFFLINE raw transactions?
It is possible to sign transaction with web3js, check the 1.0.0 version
I would also check out https://github.com/ethjs/ethjs-provider-signer
It has just what you are looking for.
I was looking for an answer to the above, figured out the following. The eth module can be used by first instantiating web3 with the default constructor and then calling the sign function.
var web3 = require('web3'); var myWeb3 = new web3(); var signedTx = myWeb3.eth.signTransaction(tx, privateKey [, callback]);